pgsql: pg_dump: Don't leak memory in buildDefaultACLCommands()

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: pg_dump: Don't leak memory in buildDefaultACLCommands()
Date: 2017-05-07 02:59:36
Message-ID: E1d7CQ4-0004Wy-7y@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pg_dump: Don't leak memory in buildDefaultACLCommands()

buildDefaultACLCommands() didn't destroy the string buffer created in
certain cases, leading to a memory leak. Fix by destroying the buffer
before returning from the function.

Spotted by Coverity.

Author: Michael Paquier

Back-patch to 9.6 where buildDefaultACLCommands() was added.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/09f842181943b6e83b0779f2e872ff0180b66883

Modified Files
--------------
src/bin/pg_dump/dumputils.c | 6 ++++++
1 file changed, 6 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2017-05-07 03:32:06 pgsql: doc PG 10: adjustments to BRIN, WAL, JSON, XML items, syntax
Previous Message Robert Haas 2017-05-07 02:24:27 pgsql: Allow queries submitted by postgres_fdw to be canceled.