Free memory properly in pg_restore.c
authorAndrew Dunstan <[email protected]>
Sat, 12 Apr 2025 18:54:48 +0000 (14:54 -0400)
committerAndrew Dunstan <[email protected]>
Sat, 12 Apr 2025 18:54:48 +0000 (14:54 -0400)
Thinko in commit 39729ec01d2. Mea maxima culpa.

Per Mahendra Singh Thalor <[email protected]>

src/bin/pg_dump/pg_restore.c

index 24a44b81a953c8f651f0c8621f67e57f41d7c829..ff4bb320fc9ea668bb378564a0e3ec37609e62d3 100644 (file)
@@ -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)