Re: Small psql memory fix

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Small psql memory fix
Дата
Msg-id 20140215043508.GB15047@momjian.us
обсуждение исходный текст
Ответ на Re: Small psql memory fix  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Small psql memory fix  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, Feb 14, 2014 at 11:28:49PM -0500, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > The attached tiny patch fixes a small leak in psql's \gset command and
> > simplifies memory freeing in two places.
>
> The first and third hunks look to me like they introduce memory
> leaks, not fix them.  The second hunk is probably safe enough,

The first and third just move the free into blocks where we have already
tested the value is not null.  It just more clearly matches the
surrounding code.  Do you see something different?

> although I'm not sure the case can actually occur --- gset should
> free the prefix before any new backslash command can be executed.

Oh, interesting idea.  Updated patch attached.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Small psql memory fix
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Small psql memory fix