From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Always pfree strings returned by GetDatabasePath
Date: Mon, 25 Apr 2022 08:39:12 +0000
Message-ID: <E1niuFU-00127a-7o@gemulon.postgresql.org> (raw)
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.
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/0bd56172b2871e94c0d7115ffbf430308317ac49
Modified Files
--------------
src/backend/commands/dbcommands.c | 13 +++++++++++++
src/backend/utils/init/postinit.c | 1 +
2 files changed, 14 insertions(+)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: alvherre@alvh.no-ip.org
Subject: Re: pgsql: Always pfree strings returned by GetDatabasePath
In-Reply-To: <E1niuFU-00127a-7o@gemulon.postgresql.org>
References: <E1niuFU-00127a-7o@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox