Always pfree strings returned by GetDatabasePath
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 25 Apr 2022 08:32:13 +0000 (10:32 +0200)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 25 Apr 2022 08:32:13 +0000 (10:32 +0200)
commit0bd56172b2871e94c0d7115ffbf430308317ac49
treeaaf886bec977d52b8191a0a284437f7667a6556f
parentf819020d400f1dbd96ee1a9fd44a1f6f44932b4d
Always pfree strings returned by GetDatabasePath

Several places didn't do it, and in many cases it didn't matter because
it would be a small allocation in a short-lived context; but other
places may accumulate a few (for example, in CreateDatabaseUsingFileCopy,
one per tablespace).  In most databases this is highly unlikely to be
very serious either, but it seems better to make the code consistent in
case there's future copy-and-paste.

The only case of actual concern seems to be the aforementioned routine,
which is new with commit 9c08aea6a309, so there's no need to backpatch.

As pointed out by Coverity.
src/backend/commands/dbcommands.c
src/backend/utils/init/postinit.c