From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: ecpg: fix some memory leakage of data-type-related structures.
Date: Wed, 27 Nov 2024 17:50:41 +0000
Message-ID: <E1tGMBV-003mYZ-2d@gemulon.postgresql.org> (raw)
ecpg: fix some memory leakage of data-type-related structures.
ECPGfree_type() and related functions were quite incomplete
about removing subsidiary data structures. Possibly this is
because ecpg wasn't careful to make sure said data structures
always had their own storage. Previous patches in this series
cleaned up a lot of that, and I had to add a couple more
mm_strdup's here.
Also, ecpg.trailer tended to overwrite struct_member_list[struct_level]
without bothering to free up its previous contents, thus potentially
leaking a lot of struct-member-related storage. Add
ECPGfree_struct_member() calls at appropriate points.
Discussion: https://postgr.es/m/2011420.1713493114@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/0e6060790d6533847084770845c84e81862bff47
Modified Files
--------------
src/interfaces/ecpg/preproc/ecpg.header | 17 +++++++++++++++--
src/interfaces/ecpg/preproc/ecpg.trailer | 11 +++++++++--
src/interfaces/ecpg/preproc/type.c | 15 +++++++++------
src/interfaces/ecpg/preproc/type.h | 5 +++--
src/interfaces/ecpg/preproc/variable.c | 7 ++++++-
5 files changed, 42 insertions(+), 13 deletions(-)
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: fix some memory leakage of data-type-related structures.
In-Reply-To: <E1tGMBV-003mYZ-2d@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