libpq: Remove redundant null pointer checks before free()
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-06-16T20:07:33Z
Lists: pgsql-hackers
Attachments
- 0001-libpq-Remove-redundant-null-pointer-checks-before-fr.patch (text/plain) patch 0001
libpq contains a lot of
if (foo)
free(foo);
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.
Commits
-
Remove redundant null pointer checks before PQclear and PQconninfoFree
- 5faef9d58201 16.0 landed
-
Remove redundant null pointer checks before free()
- 02c408e21a6e 16.0 landed
-
Remove redundant null pointer checks before pg_free()
- 098c703d308f 16.0 landed