From f09088a01d3372fdfe5da12dd0b2e24989f0caa6 Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Sat, 12 Apr 2025 14:54:48 -0400 Subject: [PATCH] Free memory properly in pg_restore.c Thinko in commit 39729ec01d2. Mea maxima culpa. Per Mahendra Singh Thalor --- src/bin/pg_dump/pg_restore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c index 24a44b81a95..ff4bb320fc9 100644 --- a/src/bin/pg_dump/pg_restore.c +++ b/src/bin/pg_dump/pg_restore.c @@ -906,7 +906,7 @@ read_one_statement(StringInfo inBuf, FILE *pfile) appendStringInfoChar(inBuf, (char) '\n'); } - destroyStringInfo(&q); + pg_free(q.data); /* No input before EOF signal means time to quit. */ if (c == EOF && inBuf->len == 0)