Re: Memory leak fix in rmtree.c

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Ильясов Ян <ianilyasov(at)outlook(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Memory leak fix in rmtree.c
Date: 2024-02-06 09:40:27
Message-ID: 466B942B-1FAF-4E7F-A369-F956A44C8C73@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 6 Feb 2024, at 10:34, Ильясов Ян <ianilyasov(at)outlook(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2024-02-06 09:53:06 Re: Synchronizing slots from primary to standby
Previous Message Ильясов Ян 2024-02-06 09:34:42 Memory leak fix in rmtree.c