Re: libpq: Remove redundant null pointer checks before free() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: libpq: Remove redundant null pointer checks before free()
Date
Msg-id 2216816.1655660311@sss.pgh.pa.us
Whole thread Raw
In response to Re: libpq: Remove redundant null pointer checks before free()  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> For PQclear() specifically, one thing that I thought a few days ago
> would be useful would to have it return (PGresult *) NULL.  Then the
> very common pattern of doing "PQclear(res); res = NULL;" could be
> simplified to "res = PQclear(res);", which is nicely compact and is
> learned instantly.

That's a public API unfortunately, and so some people would demand
a libpq.so major version bump if we changed it.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: libpq: Remove redundant null pointer checks before free()
Next
From: Michael Paquier
Date:
Subject: Re: Add header support to text format and matching feature