From e1e6f8f3dfe141839220875270a81ad3a719e0b6 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Tue, 27 Sep 2022 09:15:07 +0900 Subject: Remove dependency to StringInfo in xlogbackup.{c.h} This was used as the returned result type of the generated contents for the backup_label and backup history files. This is replaced by a simple string, reducing the cleanup burden of all the callers of build_backup_content(). Reviewed-by: Bharath Rupireddy Discussion: https://postgr.es/m/YzERvNPaZivHEKZJ@paquier.xyz --- src/backend/access/transam/xlog.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/backend/access/transam/xlog.c') diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 7606ee128a9..1dd6df0fe15 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -8711,7 +8711,7 @@ do_pg_backup_stop(BackupState *state, bool waitforarchive) } else { - StringInfo history_file; + char *history_file; /* * Write the backup-end xlog record @@ -8751,8 +8751,7 @@ do_pg_backup_stop(BackupState *state, bool waitforarchive) /* Build and save the contents of the backup history file */ history_file = build_backup_content(state, true); - fprintf(fp, "%s", history_file->data); - pfree(history_file->data); + fprintf(fp, "%s", history_file); pfree(history_file); if (fflush(fp) || ferror(fp) || FreeFile(fp)) -- cgit v1.2.3