Add destroyStringInfo function for cleaning up StringInfos
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Sat, 16 Mar 2024 22:18:28 +0000 (23:18 +0100)
committerDaniel Gustafsson <dgustafsson@postgresql.org>
Sat, 16 Mar 2024 22:18:28 +0000 (23:18 +0100)
commitb7831865159d5fb6f0d263e6023f0986589fe254
treef6525ed20cab8159e66d39a0fd7e5ca754bf21aa
parent927332b95e778c0d15a9fbf96e3efeab0d3d937c
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@yesql.se>
Author: Jacob Champion <jacob.champion@enterprisedb.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CAOYmi+mWdTd6ujtyF7MsvXvk7ToLRVG_tYAcaGbQLvf=N4KrQw@mail.gmail.com
src/backend/backup/basebackup.c
src/backend/commands/subscriptioncmds.c
src/backend/utils/adt/jsonb.c
src/backend/utils/adt/xml.c
src/bin/pg_combinebackup/pg_combinebackup.c
src/common/stringinfo.c
src/include/lib/stringinfo.h
src/test/regress/pg_regress.c