Re: Avoid possible memory leak (src/common/rmtree.c) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: Avoid possible memory leak (src/common/rmtree.c)
Date
Msg-id CAEudQAqGn33+p=ZtaGUBTEUYc1727xaN6vbRkBPu+61dXPiM9w@mail.gmail.com
Whole thread Raw
In response to Re: Avoid possible memory leak (src/common/rmtree.c)  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Avoid possible memory leak (src/common/rmtree.c)
List pgsql-hackers


Em sex, 28 de jul de 2023 11:54 PM, Michael Paquier <michael@paquier.xyz> escreveu:
On Tue, Jul 25, 2023 at 04:45:22PM +0200, Daniel Gustafsson wrote:
> Skimming the tree there doesn't seem to be any callers which aren't exiting or
> ereporting on failure so the real-world impact seems low.  That being said,
> silencing static analyzers could be reason enough to delay allocation.

A different reason would be out-of-core code that uses rmtree() in a
memory context where the leak would be an issue if facing a failure
continuously?  Delaying the allocation after the OPENDIR() seems like
a good practice anyway.
Thanks for the commit, Michael.

best regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: pltcl tests fail with FreeBSD 13.2
Next
From: Tom Lane
Date:
Subject: Re: pltcl tests fail with FreeBSD 13.2