pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove redundant null pointer checks before free()
Date: Sun, 03 Jul 2022 09:54:33 +0000
Message-ID: <E1o7wJE-000ysr-Bq@gemulon.postgresql.org> (raw)

Remove redundant null pointer checks before free()

Per applicable standards, free() with a null pointer is a no-op.
Systems that don't observe that are ancient and no longer relevant.
Some PostgreSQL code already required this behavior, so this change
does not introduce any new requirements, just makes the code more
consistent.

Discussion: https://www.postgresql.org/message-id/flat/dac5d2d0-98f5-94d9-8e69-46da2413593d%40enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/02c408e21a6e78ff246ea7a1beb4669634fa9c4c

Modified Files
--------------
contrib/pg_stat_statements/pg_stat_statements.c |  12 +-
contrib/uuid-ossp/uuid-ossp.c                   |   6 +-
src/backend/bootstrap/bootstrap.c               |   3 +-
src/backend/libpq/auth.c                        |   5 +-
src/backend/postmaster/postmaster.c             |   3 +-
src/backend/regex/regc_pg_locale.c              |   6 +-
src/backend/tcop/postgres.c                     |   3 +-
src/backend/utils/adt/pg_locale.c               |  30 ++--
src/backend/utils/error/elog.c                  |   3 +-
src/backend/utils/init/miscinit.c               |   3 +-
src/backend/utils/misc/guc.c                    |  24 +--
src/bin/pg_basebackup/pg_basebackup.c           |   3 +-
src/bin/pg_basebackup/streamutil.c              |   3 +-
src/bin/pg_dump/dumputils.c                     |  21 +--
src/bin/pg_dump/pg_backup_archiver.c            |  60 +++----
src/bin/pg_dump/pg_backup_custom.c              |   6 +-
src/bin/pg_dump/pg_backup_db.c                  |   3 +-
src/bin/pg_dump/pg_backup_tar.c                 |   3 +-
src/bin/pg_dump/pg_dump.c                       |  30 ++--
src/bin/pg_dump/pg_dumpall.c                    |   6 +-
src/bin/pgbench/pgbench.c                       |   6 +-
src/bin/psql/command.c                          |  66 +++-----
src/bin/psql/copy.c                             |   3 +-
src/bin/psql/describe.c                         |   6 +-
src/bin/psql/input.c                            |   3 +-
src/bin/psql/tab-complete.c                     |  15 +-
src/common/fe_memutils.c                        |   3 +-
src/fe_utils/connect_utils.c                    |   3 +-
src/fe_utils/string_utils.c                     |   6 +-
src/interfaces/ecpg/pgtypeslib/numeric.c        |   6 +-
src/interfaces/ecpg/preproc/descriptor.c        |   3 +-
src/interfaces/libpq/fe-auth-scram.c            |  33 ++--
src/interfaces/libpq/fe-auth.c                  |  18 +-
src/interfaces/libpq/fe-connect.c               | 211 ++++++++----------------
src/interfaces/libpq/fe-exec.c                  |   6 +-
src/interfaces/libpq/fe-print.c                 |  23 +--
src/interfaces/libpq/fe-secure-common.c         |   3 +-
src/port/getaddrinfo.c                          |   3 +-
38 files changed, 214 insertions(+), 436 deletions(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1o7wJE-000ysr-Bq@gemulon.postgresql.org>
Permalink:  ../E1o7wJE-000ysr-Bq@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1o7wJE-000ysr-Bq@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org
  Subject: Re: pgsql: Remove redundant null pointer checks before free()
  In-Reply-To: <E1o7wJE-000ysr-Bq@gemulon.postgresql.org>
  References: <E1o7wJE-000ysr-Bq@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox