pgsql: Avoid memory leak in rmtree() when path cannot be opened

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid memory leak in rmtree() when path cannot be opened
Date: 2023-07-31 02:37:09
Message-ID: E1qQImS-0025WV-8b@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2023-07-31 07:21:05 pgsql: Add WAIT_EVENT_{CLASS,ID}_MASK in wait_event.c
Previous Message Michael Paquier 2023-07-30 06:26:59 pgsql: Fix pg_rewind with in-place tablespaces when source is remote