pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Remove redundant null pointer checks before pg_free() 3+ messages / 1 participants [nested] [flat]
* pgsql: Remove redundant null pointer checks before pg_free() @ 2022-07-03 07:12 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 3+ messages in thread From: Peter Eisentraut @ 2022-07-03 07:12 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Remove redundant null pointer checks before pg_free() These are especially useless because the whole point of pg_free() was to do that very check before calling free(). pg_free() could be removed altogether, but I'm keeping it here to keep the API 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/098c703d308fa88dc9e3f9f623ca023ce4717794 Modified Files -------------- src/bin/pg_basebackup/walmethods.c | 3 +-- src/bin/pg_upgrade/parallel.c | 18 ++++++------------ src/bin/pgbench/pgbench.c | 9 +++------ src/bin/psql/command.c | 3 +-- src/bin/psql/variables.c | 5 ++--- 5 files changed, 13 insertions(+), 25 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Remove redundant null pointer checks before free() @ 2022-07-03 09:54 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 3+ messages in thread From: Peter Eisentraut @ 2022-07-03 09:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Remove redundant null pointer checks before PQclear and PQconnin @ 2022-07-03 18:23 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 3+ messages in thread From: Peter Eisentraut @ 2022-07-03 18:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Remove redundant null pointer checks before PQclear and PQconninfoFree These functions already had the free()-like behavior of handling null pointers as a no-op. But it wasn't documented, so add it explicitly to the documentation, too. Discussion: https://www.postgresql.org/message-id/flat/dac5d2d0-98f5-94d9-8e69-46da2413593d%40enterprisedb.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/5faef9d582012433db9ad05af27a77bd591508e1 Modified Files -------------- contrib/dblink/dblink.c | 6 ++---- contrib/postgres_fdw/postgres_fdw.c | 24 ++++++++---------------- doc/src/sgml/libpq.sgml | 5 +++++ src/bin/pg_basebackup/streamutil.c | 6 ++---- src/bin/pg_dump/pg_dumpall.c | 3 +-- src/bin/psql/command.c | 3 +-- src/bin/psql/common.c | 3 +-- src/bin/psql/describe.c | 3 +-- src/fe_utils/query_utils.c | 3 +-- src/interfaces/ecpg/ecpglib/descriptor.c | 3 +-- src/interfaces/ecpg/ecpglib/execute.c | 3 +-- src/interfaces/libpq/fe-connect.c | 6 ++---- src/interfaces/libpq/fe-exec.c | 9 +++------ 13 files changed, 29 insertions(+), 48 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2022-07-03 18:23 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-07-03 07:12 pgsql: Remove redundant null pointer checks before pg_free() Peter Eisentraut <peter@eisentraut.org> 2022-07-03 09:54 pgsql: Remove redundant null pointer checks before free() Peter Eisentraut <peter@eisentraut.org> 2022-07-03 18:23 pgsql: Remove redundant null pointer checks before PQclear and PQconnin Peter Eisentraut <peter@eisentraut.org>
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