Re: libpq: Remove redundant null pointer checks before free()

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-06-17T03:25:07Z
Lists: pgsql-hackers
On Thu, Jun 16, 2022 at 10:07:33PM +0200, Peter Eisentraut wrote:
> calls, where the "if" part is unnecessary.  This is of course pretty
> harmless, but some functions like scram_free() and freePGconn() have become
> so bulky that it becomes annoying.  So while I was doing some work in that
> area I undertook to simplify this.

Seems fine.  Would some of the buildfarm dinosaurs hiccup on that?
gaur is one that comes into mind. 
--
Michael

Commits

  1. Remove redundant null pointer checks before PQclear and PQconninfoFree

  2. Remove redundant null pointer checks before free()

  3. Remove redundant null pointer checks before pg_free()