Re: [PATHC] Fix minor memory leak in pg_basebackup

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [PATHC] Fix minor memory leak in pg_basebackup
Дата
Msg-id 20200416063036.GC81957@paquier.xyz
обсуждение исходный текст
Ответ на [PATHC] Fix minor memory leak in pg_basebackup  ("Zhang, Jie" <zhangjie2@cn.fujitsu.com>)
Ответы RE: [PATHC] Fix minor memory leak in pg_basebackup  ("Zhang, Jie" <zhangjie2@cn.fujitsu.com>)
Список pgsql-hackers
On Wed, Apr 15, 2020 at 10:06:52AM +0000, Zhang, Jie wrote:
> In some cases , PGresult is not cleared.
>
> File: src\bin\pg_basebackup\streamutil.c
>
> bool
> RetrieveWalSegSize(PGconn *conn)
> {
>     PGresult   *res;

RetrieveWalSegSize() gets called only once at the beginning of
pg_basebackup and pg_receivewal, so that's not an issue that has major
effects, still that's an issue.  The first one PQclear() is needed
where you say.  Now for the second one, I would just move it once the
code is done with the query result, aka after calling PQgetvalue().
What do you think?  Please see the attached.
--
Michael

Вложения

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

Предыдущее
От: Pierre Giraud
Дата:
Сообщение: Re: Poll: are people okay with function/operator table redesign?
Следующее
От: Amit Khandekar
Дата:
Сообщение: Re: spin_delay() for ARM