agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix mismatched deallocation functions
Date: Wed, 01 Jul 2026 11:55:07 +0000
Message-ID: <E1wetX2-000uWy-0V@gemulon.postgresql.org> (raw)
Fix mismatched deallocation functions
In fe_memutils.h, we have various allocation functions beginning with
either pg_ or p. The pg_ functions have a matching pg_free() for
freeing memory, while the p functions use pfree(). In some cases, we
were allocating memory with one set of functions while using the wrong
deallocation functions. This creates a tiny bit of mental overhead
when reading code. Matching up allocation and deallocation functions
makes it easier to analyze memory handling in a code path.
Author: Tristan Partin <tristan@partin.io>
Reviewed-by: Zsolt Parragi <zsolt.parragi@percona.com>
Discussion: https://www.postgresql.org/message-id/flat/DIBZE2B6SVF2.28R3EQTYJSWIG@partin.io
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/30652b356d20c1d3772137370a6a8d29575e04d1
Modified Files
--------------
contrib/oid2name/oid2name.c | 6 +-
src/bin/initdb/initdb.c | 14 +--
src/bin/pg_basebackup/pg_basebackup.c | 4 +-
src/bin/pg_basebackup/pg_createsubscriber.c | 12 +--
src/bin/pg_basebackup/streamutil.c | 8 +-
src/bin/pg_combinebackup/load_manifest.c | 2 +-
src/bin/pg_combinebackup/pg_combinebackup.c | 2 +-
src/bin/pg_combinebackup/reconstruct.c | 8 +-
src/bin/pg_ctl/pg_ctl.c | 10 +-
src/bin/pg_dump/compress_gzip.c | 8 +-
src/bin/pg_dump/compress_lz4.c | 2 +-
src/bin/pg_dump/compress_none.c | 2 +-
src/bin/pg_dump/connectdb.c | 12 +--
src/bin/pg_dump/dumputils.c | 4 +-
src/bin/pg_dump/parallel.c | 2 +-
src/bin/pg_dump/pg_backup_archiver.c | 28 ++---
src/bin/pg_dump/pg_backup_custom.c | 4 +-
src/bin/pg_dump/pg_backup_db.c | 4 +-
src/bin/pg_dump/pg_backup_directory.c | 2 +-
src/bin/pg_dump/pg_backup_tar.c | 6 +-
src/bin/pg_dump/pg_dump.c | 128 +++++++++++------------
src/bin/pg_dump/pg_dump_sort.c | 12 +--
src/bin/pg_dump/pg_dumpall.c | 4 +-
src/bin/pg_upgrade/check.c | 8 +-
src/bin/pg_upgrade/function.c | 2 +-
src/bin/pg_verifybackup/pg_verifybackup.c | 4 +-
src/bin/pgbench/pgbench.c | 4 +-
src/bin/psql/command.c | 10 +-
src/bin/psql/common.c | 4 +-
src/bin/psql/describe.c | 14 +--
src/bin/psql/help.c | 2 +-
src/bin/psql/input.c | 2 +-
src/bin/psql/large_obj.c | 4 +-
src/bin/psql/mainloop.c | 12 +--
src/bin/psql/prompt.c | 4 +-
src/bin/psql/startup.c | 14 +--
src/bin/psql/stringutils.c | 6 +-
src/bin/psql/tab-complete.in.c | 32 +++---
src/bin/scripts/vacuuming.c | 2 +-
src/common/logging.c | 2 +-
src/fe_utils/print.c | 40 +++----
src/interfaces/ecpg/test/pg_regress_ecpg.c | 2 +-
src/test/isolation/isolation_main.c | 2 +-
src/test/isolation/isolationtester.c | 10 +-
src/test/modules/libpq_pipeline/libpq_pipeline.c | 8 +-
src/test/regress/pg_regress.c | 6 +-
src/test/regress/pg_regress_main.c | 2 +-
47 files changed, 240 insertions(+), 240 deletions(-)
Message-ID: <E1wetX2-000uWy-0V@gemulon.postgresql.org>
Permalink: ../E1wetX2-000uWy-0V@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1wetX2-000uWy-0V@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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix mismatched deallocation functions
In-Reply-To: <E1wetX2-000uWy-0V@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox