From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Free temporary memory when reading TOC
Date: Wed, 09 Feb 2022 13:13:53 +0000
Message-ID: <E1nHmnB-0004c6-Ng@gemulon.postgresql.org> (raw)
Free temporary memory when reading TOC
ReadStr returns allocated memory which the caller is responsible for
freeing when done with the string. This commit ensures that memory is
freed in one case which used ReadStr in a conditional. While the leak
might not be too concerning, this makes the code consistent across all
ReadStr callsites in ReadToc. Due to the lack of complaints of issues
in production from this, no backpatch is performed at this point.
Author: Bharath Rupireddy, Georgios Kokolatos
Reviewed-by: Kyotaro Horiguchi
Discussion: https://postgr.es/m/oZwKiUxFsVaetG2xOJp7Hwao8F1AKIdfFDQLNJrnwoaxmjyB-45r_aYmhgXHKLcMI3GT24m9L6HafSi2...
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/1a29217a00a34162ca0ffac336d83f28132330a6
Modified Files
--------------
src/bin/pg_dump/pg_backup_archiver.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
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: dgustafsson@postgresql.org
Subject: Re: pgsql: Free temporary memory when reading TOC
In-Reply-To: <E1nHmnB-0004c6-Ng@gemulon.postgresql.org>
References: <E1nHmnB-0004c6-Ng@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