Re: Collection of memory leaks for ECPG driver

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Collection of memory leaks for ECPG driver
Дата
Msg-id CAB7nPqRbG4C3LMZk1U_j-E2k4T1_6wwR9foqyExNF_T4eh8zrw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Collection of memory leaks for ECPG driver  (Michael Meskes <meskes@postgresql.org>)
Ответы Re: Collection of memory leaks for ECPG driver  (Michael Meskes <meskes@postgresql.org>)
Список pgsql-hackers
On Sat, Jun 13, 2015 at 6:25 PM, Michael Meskes <meskes@postgresql.org> wrote:
> On Sat, Jun 13, 2015 at 12:02:40AM -0400, Tom Lane wrote:
>> But having said that, I would not be in a hurry to remove any existing
>> if-guards for the case.  For one thing, it makes the code look more
>> similar to backend code that uses palloc/pfree, where we do *not* allow
>> pfree(NULL).  There's also the point that changing longstanding code
>> creates back-patching hazards, so unless there's a clear gain it's best
>> not to.
>
> Makes sense, but there is no point in adding hos if-guards to old code that
> doesn't have it either,right?

In any case, whatever the final decision done here, I just wanted to
point out that there is still a leak in connect.c. Per se the attached
patch, that does not check for a NULL pointer before ecpg_free because
other code paths in the routine patched don't do so. So you get
something locally consistent ;)
--
Michael

Вложения

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

Предыдущее
От: Thom Brown
Дата:
Сообщение: Re: Problem with CREATE TABLE ... (LIKE ... INCLUDING INDEXES)
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: 9.5 release notes