pgsql: Fix out-of-memory handling in ecpglib. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix out-of-memory handling in ecpglib.
Date
Msg-id E1itKix-0002qm-1O@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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.

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c7c2cc67007741338a36a8d7aa86e23600aa5e18

Modified Files
--------------
src/interfaces/ecpg/ecpglib/execute.c | 37 +++++++++++++++++++++++------------
1 file changed, 24 insertions(+), 13 deletions(-)


pgsql-committers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: pgsql: Add a non-strict version of jsonb_set
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Add a non-strict version of jsonb_set