pgsql: Add destroyStringInfo function for cleaning up StringInfos

From: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add destroyStringInfo function for cleaning up StringInfos
Date: 2024-03-16 22:22:48
Message-ID: E1rlcQS-004ApL-IN@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add destroyStringInfo function for cleaning up StringInfos

destroyStringInfo() is a counterpart to makeStringInfo(), freeing a
palloc'd StringInfo and its data. This is a convenience function to
align the StringInfo API with the PQExpBuffer API. Originally added
in the OAuth patchset, it was extracted and committed separately in
order to aid upcoming JSON work.

Author: Daniel Gustafsson <daniel(at)yesql(dot)se>
Author: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Discussion: https://postgr.es/m/CAOYmi+mWdTd6ujtyF7MsvXvk7ToLRVG_tYAcaGbQLvf=N4KrQw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b7831865159d5fb6f0d263e6023f0986589fe254

Modified Files
--------------
src/backend/backup/basebackup.c | 3 +--
src/backend/commands/subscriptioncmds.c | 3 +--
src/backend/utils/adt/jsonb.c | 3 +--
src/backend/utils/adt/xml.c | 6 ++----
src/bin/pg_combinebackup/pg_combinebackup.c | 5 +----
src/common/stringinfo.c | 16 ++++++++++++++++
src/include/lib/stringinfo.h | 9 ++++++++-
src/test/regress/pg_regress.c | 3 +--
8 files changed, 31 insertions(+), 17 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2024-03-17 05:05:24 pgsql: Separate equalRowTypes() from equalTupleDescs()
Previous Message Alexander Korotkov 2024-03-16 22:05:31 pgsql: psql: fix variable existence tab completion