Re: [PATCH] Fix potential memoryleak in guc.c

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] Fix potential memoryleak in guc.c
Дата
Msg-id 8849.1560132766@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [PATCH] Fix potential memoryleak in guc.c  ("Zhang, Jie" <zhangjie2@cn.fujitsu.com>)
Список pgsql-hackers
"Zhang, Jie" <zhangjie2@cn.fujitsu.com> writes:
> In src\backend\utils\misc\guc.c, I found a potential memory leak.
> make_absolute_path() return a malloc'd copy, we should free memory before the function return false.

If SelectConfigFiles were executed more than once per postmaster
launch, this might be worth adding code for ... but as-is, I'm
dubious.  There are a few tens of KB of other one-time leaks
that we don't worry about removing.

Even more to the point, the particular code path you're complaining
about is a failure exit that will lead to immediate process
termination, so there really is no point in adding code there.

            regards, tom lane



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

Предыдущее
От: Ian Barwick
Дата:
Сообщение: doc: clarify "pg_signal_backend" default role
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: pg_upgrade: prep_status doesn't translate messages