Re: libpq: Remove redundant null pointer checks before free()

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: libpq: Remove redundant null pointer checks before free()
Дата
Msg-id 5eb1b215-acc2-9922-50d8-fc57a3e4f5e8@enterprisedb.com
обсуждение исходный текст
Ответ на Re: libpq: Remove redundant null pointer checks before free()  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: libpq: Remove redundant null pointer checks before free()  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: libpq: Remove redundant null pointer checks before free()  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
On 17.06.22 07:11, Tom Lane wrote:
> Having said that, the pattern "if (x) free(x);" is absolutely
> ubiquitous across our code, and so I'm not sure that I'm on
> board with undoing it only in libpq.  I'd be happier if we made
> a push to get rid of it everywhere.

Sure, here is a more comprehensive patch set.  (It still looks like 
libpq is the largest chunk.)

> Notably, I think the choice
> that pfree(NULL) is disallowed traces directly to worries about
> coding-pattern-compatibility with pre-POSIX free().  Should we
> revisit that?

Yes please, and also repalloc().
Вложения

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: libpq: Remove redundant null pointer checks before free()
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: SGML doc file references