Re: Memory leak fix in psql

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Memory leak fix in psql
Дата
Msg-id 1212323.1658248591@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Memory leak fix in psql  (Andres Freund <andres@anarazel.de>)
Ответы Re: Memory leak fix in psql
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2022-07-19 21:08:53 +0800, Japin Li wrote:
>> +    {
>> +        termPQExpBuffer(&buf);
>>          return false;
>> +    }

> Adding copy over copy of this same block doesn't seem great. Can we instead
> add a helper for it or such?

The usual style in these files is something like

    if (bad things happened)
        goto fail;

    ...

fail:
    termPQExpBuffer(&buf);
    return false;

Yeah, it's old school, but please let's not have a few functions that
do it randomly differently from all their neighbors.

            regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Convert planner's AggInfo and AggTransInfo to Nodes
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCH] Log details for client certificate failures