Fix out-of-memory handling in ecpglib.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 20 Jan 2020 00:15:15 +0000 (19:15 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 20 Jan 2020 00:15:15 +0000 (19:15 -0500)
commit44f1fc8df5dadbc5e80661660903aab4076d868f
treec86300ddb7c33b3a584d68f639899a8694ea84a9
parent9c679a08f0cdedcf7f084daea3cba6ae9c3cbced
Fix out-of-memory handling in ecpglib.

ecpg_build_params() would crash on a null pointer dereference if
realloc() failed, due to updating the persistent "stmt" struct
too aggressively.  (Even without the crash, this would've leaked
the old storage that we were trying to realloc.)

Per Coverity.  This seems to have been broken in commit 0cc050794,
so back-patch into v12.
src/interfaces/ecpg/ecpglib/execute.c