pgsql: ecpg: fix some memory leakage of data-type-related structures.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: ecpg: fix some memory leakage of data-type-related structures.
Date: 2024-11-27 17:50:41
Message-ID: E1tGMBV-003mYZ-2d@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Álvaro Herrera 2024-11-27 18:56:23 pgsql: Remove redundant relam initialization
Previous Message Andrew Dunstan 2024-11-27 17:14:56 pgsql: jsonapi: add lexer option to keep token ownership