pgsql: Fix memory leaks in scripts/vacuuming.c. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix memory leaks in scripts/vacuuming.c.
Date
Msg-id E1vBeMp-002zh6-0k@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix memory leaks in scripts/vacuuming.c.

Coverity complained that the list of table names returned by
retrieve_objects() was leaked, and it's right.  Potentially this
is quite a lot of memory; however, it's not entirely clear how much
we gain by cleaning it up, since in many operating modes we're going
to need the list until the program is about to exit.  Still, it will
win in some cases, so fix the leak.

vacuuming.c is new in v19, and this patch doesn't apply at all cleanly
to the predecessor code in v18.  I'm not excited enough about the
issue to devise a back-patch.

Branch
------
master

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

Modified Files
--------------
src/bin/scripts/vacuuming.c | 61 ++++++++++++++++++++++++++++++++++++---------
1 file changed, 49 insertions(+), 12 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix memory leaks in pg_combinebackup/reconstruct.c.
Next
From: Tom Lane
Date:
Subject: pgsql: Remove useless pstrdup() calls.