libpq: Remove redundant null pointer checks before free()

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: libpq: Remove redundant null pointer checks before free()
Date: 2022-06-16 20:07:33
Message-ID: dac5d2d0-98f5-94d9-8e69-46da2413593d@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Attachment Content-Type Size
0001-libpq-Remove-redundant-null-pointer-checks-before-fr.patch text/plain 16.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2022-06-16 20:29:52 Re: Typo in ro.po file?
Previous Message Peter Eisentraut 2022-06-16 20:04:23 Re: SGML doc file references