Re: Missing NULL check after calling ecpg_strdup

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Evgeniy Gorbanev <gorbanyoves(at)basealt(dot)ru>
Subject: Re: Missing NULL check after calling ecpg_strdup
Date: 2025-07-22 23:34:14
Message-ID: aIAf9oDuO5DIaasA@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 22, 2025 at 04:20:53PM +0300, Aleksander Alekseev wrote:
> v7 may have a compilation warning on Linux:
>
> ```
> warning: unused variable ‘alloc_failed’ [-Wunused-variable]
> ```
>
> ... because the only use of the variable is hidden under #ifdef's.

Yep, thanks, didn't see this one coming. Doing a CI run was still on
my list of things still to do. I have just done one after a second
lookup and I think that we should be OK.

What you are suggesting for ECPGget_desc() is fine by me at the end.
Both are immediate failure checks and the first one is never expected
to be NULL, but the second with setlocale() needs that, so...

Applied v8 on HEAD.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-07-22 23:59:40 Re: Support for 8-byte TOAST values (aka the TOAST infinite loop problem)
Previous Message Masahiko Sawada 2025-07-22 23:22:33 Re: Support getrandom() for pg_strong_random() source