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

Started by Michael Paquieralmost 3 years ago1 messagescomitters
Jump to latest
#1Michael Paquier
michael@paquier.xyz

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: /messages/by-id/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(-)