Re: Memory leak fix in rmtree.c - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Memory leak fix in rmtree.c
Date
Msg-id 466B942B-1FAF-4E7F-A369-F956A44C8C73@yesql.se
Whole thread Raw
In response to Memory leak fix in rmtree.c  (Ильясов Ян <ianilyasov@outlook.com>)
Responses RE: Memory leak fix in rmtree.c
List pgsql-hackers
> On 6 Feb 2024, at 10:34, Ильясов Ян <ianilyasov@outlook.com> wrote:

> Just like some of my colleagues I've been using Svace*
> and I think I've found a bug in src/common/rmtree.c .
>
> In 64th line function returns false in case it couldn't open a directory,
> but the memory, that have been allocated for char** dirnames is
> not freed.

dirnames isn't allocated at this point, it's palloc'd after this return
statement on line 67.

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Ильясов Ян
Date:
Subject: Memory leak fix in rmtree.c
Next
From: Dilip Kumar
Date:
Subject: Re: Synchronizing slots from primary to standby