Re: libpq: Remove redundant null pointer checks before free()
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: libpq: Remove redundant null pointer checks before free() |
| Дата | |
| Msg-id | 1477430.1655523953@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: libpq: Remove redundant null pointer checks before free() (Michael Paquier <michael@paquier.xyz>) |
| Список | pgsql-hackers |
Michael Paquier <michael@paquier.xyz> writes:
> On Fri, Jun 17, 2022 at 09:03:23PM +0200, Peter Eisentraut wrote:
>> I'm pretty sure PostgreSQL code already depends on this behavior anyway.
>> The code just isn't consistent about it.
> In the frontend, I'd like to think that you are right and that we have
> already some places doing that.
We do, indeed.
> The backend is a different story,
> like in GetMemoryChunkContext(). That should be easy enough to check
> with some LD_PRELOAD wizardry, at least.
Huh? The proposal is to accept the fact that free() tolerates NULL,
and then maybe make pfree() tolerate it as well. I don't think that
that needs to encompass any other functions.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера