Add destroyStringInfo function for cleaning up StringInfos

Daniel Gustafsson <dgustafsson@postgresql.org>

Commit: b7831865159d5fb6f0d263e6023f0986589fe254
Author: Daniel Gustafsson <dgustafsson@postgresql.org>
Date: 2024-03-16T22:18:28Z
Releases: 17.0
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

Files

Discussion