Re: Missing NULL check after calling ecpg_strdup - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: Missing NULL check after calling ecpg_strdup
Date
Msg-id CAJ7c6TNeG-e0BJtgAWT4eU0-tuQ7XZXcPzUe-GsiLuaiXK5tcw@mail.gmail.com
Whole thread Raw
In response to Re: Missing NULL check after calling ecpg_strdup  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Hi Michael,

Thanks for all your great feedback.

> Or you could keep the "lineno" and the error generated in memory.c as
> this gives enough details about the location where the problem
> happens.  We are going to need the extra "alloc_failed".
>
> [...]
>
> Hmm.  But both are related and the same problem, no?  This is touching
> the same code paths..
>
> [...]
>
> Nope, we could keep this shortcut in ecpg_strdup() as long as there is
> an extra field to track if an error has happened.

OK, patch 0002 implements this idea with minimal changes to the existing logic.

Attachment

pgsql-hackers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: Fix lwlock.c and wait_event_names.txt discrepancy
Next
From: Andrey Borodin
Date:
Subject: Re: IPC/MultixactCreation on the Standby server