From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid memory leak in rmtree() when path cannot be opened
Date: Mon, 31 Jul 2023 02:37:09 +0000
Message-ID: <E1qQImS-0025WV-8b@gemulon.postgresql.org> (raw)
Avoid memory leak in rmtree() when path cannot be opened
An allocation done for the directory names to recurse into for their
deletion was done before OPENDIR(), so, assuming that a failure happens,
this could leak a bit of memory.
Author: Ranier Vilela
Reviewed-by: Daniel Gustafsson
Discussion: https://postgr.es/m/CAEudQAoN3-2ZKBALThnEk_q2hu8En5A0WG9O+5siJTQKVZzoWQ@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/f1e9f6bbfa536992eac6c094882b3afcd9e90fb4
Modified Files
--------------
src/common/rmtree.c | 4 +++-
1 file changed, 3 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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Avoid memory leak in rmtree() when path cannot be opened
In-Reply-To: <E1qQImS-0025WV-8b@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