Re: libpq async duplicate error results - Mailing list pgsql-hackers

From Tom Lane
Subject Re: libpq async duplicate error results
Date
Msg-id 3518938.1645061282@sss.pgh.pa.us
Whole thread Raw
In response to Re: libpq async duplicate error results  (Andres Freund <andres@anarazel.de>)
Responses Re: libpq async duplicate error results  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2022-02-16 18:51:37 -0500, Tom Lane wrote:
>> +    /* Also, do nothing if the argument is OOM_result */
>> +    if (res == unconstify(PGresult *, &OOM_result))
>> +        return;

> Wouldn't it make more sense to make res const, rather than unconstifying
> &OOM_result?

Uh ... then we'd have to cast away the const to do free().

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Race conditions in 019_replslot_limit.pl
Next
From: Michael Paquier
Date:
Subject: Re: Small TAP tests cleanup for Windows and unused modules