pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: ecpg: clean up some other assorted memory leaks.
Date: Wed, 27 Nov 2024 17:50:41 +0000
Message-ID: <E1tGMBV-003mYd-4O@gemulon.postgresql.org> (raw)

ecpg: clean up some other assorted memory leaks.

Avoid leaking the prior value when updating the "connection"
state variable.

Ditto for ECPGstruct_sizeof.  (It seems like this one ought to
be statement-local, but testing says it isn't, and I didn't
feel like diving deeper.)

The actual_type[] entries are statement-local, though, so
no need to mm_strdup() strings stored in them.

Likewise, sqlda variables are statement-local, so we can
loc_alloc them.

Also clean up sloppiness around management of the argsinsert and
argsresult lists.

progname changes are strictly to prevent valgrind from complaining
about leaked allocations.

With this, valgrind reports zero leakage in the ecpg preprocessor
for all of our ecpg regression test cases.

Discussion: https://postgr.es/m/2011420.1713493114@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2b41de4a5b429c53ae5fb5ff92b2e9822fd2cd9a

Modified Files
--------------
src/interfaces/ecpg/preproc/descriptor.c | 14 +++++++---
src/interfaces/ecpg/preproc/ecpg.addons  | 47 ++++++++++++--------------------
src/interfaces/ecpg/preproc/ecpg.c       |  2 +-
src/interfaces/ecpg/preproc/ecpg.header  | 17 +++++++++++-
src/interfaces/ecpg/preproc/ecpg.trailer | 31 ++++++++++++---------
src/interfaces/ecpg/preproc/output.c     |  3 +-
src/interfaces/ecpg/preproc/variable.c   | 25 +++++++++++++++--
7 files changed, 86 insertions(+), 53 deletions(-)



Message-ID: <E1tGMBV-003mYd-4O@gemulon.postgresql.org>
Permalink:  ../E1tGMBV-003mYd-4O@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tGMBV-003mYd-4O@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: ecpg: clean up some other assorted memory leaks.
  In-Reply-To: <E1tGMBV-003mYd-4O@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox