pg_dump: Don't leak memory in buildDefaultACLCommands()

Stephen Frost <sfrost@snowman.net>

Commit: ef42c1103708cbbb77fff674f339d452a13aac14
Author: Stephen Frost <sfrost@snowman.net>
Date: 2017-05-07T02:58:22Z
Releases: 9.6.3
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.

Files

PathChange+/−
src/bin/pg_dump/dumputils.c modified +6 −0