pgsql: Fix more memory leaks in failure path in buildACLCommands.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix more memory leaks in failure path in buildACLCommands.
Date: 2015-02-11 23:35:54
Message-ID: E1YLgp0-0001eH-1I@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix more memory leaks in failure path in buildACLCommands.

We already had one go at this issue in commit d73b7f973db5ec7e, but we
failed to notice that buildACLCommands also leaked several PQExpBuffers
along with a simply malloc'd string. This time let's try to make the
fix a bit more future-proof by eliminating the separate exit path.

It's still not exactly critical because pg_dump will curl up and die on
failure; but since the amount of the potential leak is now several KB,
it seems worth back-patching as far as 9.2 where the previous fix landed.

Per Coverity, which evidently is smarter than clang's static analyzer.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/8b63f89498f2e3ff0e1d420b023ccb76c34c2cda

Modified Files
--------------
src/bin/pg_dump/dumputils.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2015-02-12 00:10:06 pgsql: Fix minor memory leak in ident_inet().
Previous Message Michael Meskes 2015-02-11 10:33:56 pgsql: Fixed array handling in ecpg.