diff options
author | Daniel Gustafsson | 2024-03-16 22:18:28 +0000 |
---|---|---|
committer | Daniel Gustafsson | 2024-03-16 22:18:28 +0000 |
commit | b7831865159d5fb6f0d263e6023f0986589fe254 (patch) | |
tree | f6525ed20cab8159e66d39a0fd7e5ca754bf21aa /src/bin/pg_combinebackup/pg_combinebackup.c | |
parent | 927332b95e778c0d15a9fbf96e3efeab0d3d937c (diff) |
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 <[email protected]>
Author: Jacob Champion <[email protected]>
Reviewed-by: Michael Paquier <[email protected]>
Discussion: https://postgr.es/m/CAOYmi+mWdTd6ujtyF7MsvXvk7ToLRVG_tYAcaGbQLvf=N4KrQw@mail.gmail.com
Diffstat (limited to 'src/bin/pg_combinebackup/pg_combinebackup.c')
-rw-r--r-- | src/bin/pg_combinebackup/pg_combinebackup.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/bin/pg_combinebackup/pg_combinebackup.c b/src/bin/pg_combinebackup/pg_combinebackup.c index 6f0814d9ac6..74f8be9eeac 100644 --- a/src/bin/pg_combinebackup/pg_combinebackup.c +++ b/src/bin/pg_combinebackup/pg_combinebackup.c @@ -526,10 +526,7 @@ check_backup_label_files(int n_backups, char **backup_dirs) /* Free memory that we don't need any more. */ if (lastbuf != buf) - { - pfree(buf->data); - pfree(buf); - } + destroyStringInfo(buf); /* * Return the data from the first backup_info that we read (which is the |