Re: Memory leak fix in rmtree.c

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: Memory leak fix in rmtree.c
Дата
Msg-id 2BD464AB-5209-4D80-81E1-2A640CC1BCA8@yesql.se
обсуждение исходный текст
Ответ на RE: Memory leak fix in rmtree.c  (Ильясов Ян <ianilyasov@outlook.com>)
Ответы RE: Memory leak fix in rmtree.c  (Ильясов Ян <ianilyasov@outlook.com>)
Список pgsql-hackers
> On 6 Feb 2024, at 11:21, Ильясов Ян <ianilyasov@outlook.com> wrote:
>
> > dirnames isn't allocated at this point, it's palloc'd after this return
> > statement on line 67.
>
> I am sorry, I pointed on the wrong branch. I see that in master
> it is really in line 67th , and the allocation goes well. But in
> REL_16_STABLE the allocation is in line 58th and my patch is for this branch only.

Ok, that makes more sense.  That was changed in commit f1e9f6bbfa53, and in the
discussion for that patch it was deemed that no callers actually suffered from
the leak as they were exiting (or erroring out) on error, so it was never back-
patched.

  https://www.postgresql.org/message-id/flat/CAEudQAoN3-2ZKBALThnEk_q2hu8En5A0WG9O%2B5siJTQKVZzoWQ%40mail.gmail.com

That still holds true today, so I don't see a big incentive to spend energy on
backpatching that since it mainly serves to silence analyzers.  Grepping for
the pattern of allocating in the declaration doesn't reveal any other codepaths
where the allocation leaks like this.

--
Daniel Gustafsson




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Synchronizing slots from primary to standby
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Printing backtrace of postgres processes