Re: BUG #15103: Do not use pfree() to free pg_malloc() return valuein vacuum_one_database()

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: BUG #15103: Do not use pfree() to free pg_malloc() return valuein vacuum_one_database()
Дата
Msg-id 20180309014841.GA25687@paquier.xyz
обсуждение исходный текст
Ответ на BUG #15103: Do not use pfree() to free pg_malloc() return value invacuum_one_database()  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
On Fri, Mar 09, 2018 at 01:32:47AM +0000, PG Bug reporting form wrote:
> Details: In function vacuum_one_database(), the memory allocated with
> pg_malloc() (at line 435), but the return value is freed with pfree() (at
> line 530). I think use the function pg_free() paired with pg_malloc() is
> better here.

In practice it does not matter much as pfree is just a wrapper on top of
pg_free().  Please see fe_memutils.c, which lists all the memory-related
APIs for frontends.
--
Michael

Вложения

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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15104: Double free in the main function in ecpg.c
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15105: OpenTransientFile() should be paired withCloseTransientFile() rather than close()