From: Andrew Dunstan Date: Thu, 10 Apr 2025 18:54:39 +0000 (-0400) Subject: Fix memory leak in pg_restore.c X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=22cb6d289500ef22163a9d7cf2afa496f41b4d4c;p=users%2Frhaas%2Fpostgres.git Fix memory leak in pg_restore.c Oversight in 1495eff7bdb Author: Ranier Vilela --- diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c index 06c28ab314..dc1f4bfbbc 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'); }