From: Andrew Dunstan Date: Sat, 12 Apr 2025 18:54:48 +0000 (-0400) Subject: Free memory properly in pg_restore.c X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=f09088a01d3372fdfe5da12dd0b2e24989f0caa6;p=users%2Frhaas%2Fpostgres.git Free memory properly in pg_restore.c Thinko in commit 39729ec01d2. Mea maxima culpa. Per Mahendra Singh Thalor --- diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c index 24a44b81a9..ff4bb320fc 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)