pgsql: ecpg: Fix memory leaks in ecpg_auto_prepare()

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: ecpg: Fix memory leaks in ecpg_auto_prepare()
Date: 2025-07-27 23:43:08
Message-ID: E1ugB1I-0013ID-0X@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

ecpg: Fix memory leaks in ecpg_auto_prepare()

This routines includes three code paths that can fail, with the
allocated prepared statement name going out of scope.

Per report from Coverity. Oversight in commit a6eabec6808c, that has
played with the order of some ecpg_strdup() calls in this code path.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3151c264d460c0be09131ce90529073631d70ae8

Modified Files
--------------
src/interfaces/ecpg/ecpglib/prepare.c | 9 +++++++++
1 file changed, 9 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2025-07-28 15:02:42 pgsql: Avoid throwing away the error message in syncrep_yyerror.
Previous Message Michael Paquier 2025-07-27 23:16:26 pgsql: Fix performance regression with flush of pending fixed-numbered