Re: Plain strdup() in frontend code

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Plain strdup() in frontend code
Дата
Msg-id 20190429130126.GA22355@paquier.xyz
обсуждение исходный текст
Ответ на Plain strdup() in frontend code  (Daniel Gustafsson <daniel@yesql.se>)
Ответы Re: Plain strdup() in frontend code  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-hackers
On Mon, Apr 29, 2019 at 11:47:27AM +0000, Daniel Gustafsson wrote:
> Reading code I noticed that we in a few rare instances use strdup() in frontend
> utilities instead of pg_strdup().  Is there a reason for not using pg_strdup()
> consistently as per the attached patch?

I think that it is good practice to encourage its use, so making
things more consistent is a good idea.  While on it, we could also
switch psql's do_lo_import() which uses a malloc() to
pg_malloc_extended() with MCXT_ALLOC_NO_OOM.  GetPrivilegesToDelete()
in pg_ctl also has an instance of malloc() with a similar failure
mode.
--
Michael

Вложения

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

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Plain strdup() in frontend code
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Refactoring the checkpointer's fsync request queue