From 22cb6d289500ef22163a9d7cf2afa496f41b4d4c Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Thu, 10 Apr 2025 14:54:39 -0400 Subject: [PATCH] Fix memory leak in pg_restore.c Oversight in 1495eff7bdb Author: Ranier Vilela --- src/bin/pg_dump/pg_restore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c index 06c28ab3149..dc1f4bfbbcd 100644 --- a/src/bin/pg_dump/pg_restore.c +++ b/src/bin/pg_dump/pg_restore.c @@ -902,6 +902,8 @@ read_one_statement(StringInfo inBuf, FILE *pfile) break; } + destroyStringInfo(&q); + if (c == '\n') appendStringInfoChar(inBuf, (char) '\n'); }