Fix fat fingering in 22cb6d28950
authorAndrew Dunstan <andrew@dunslane.net>
Thu, 10 Apr 2025 23:05:54 +0000 (19:05 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Thu, 10 Apr 2025 23:08:04 +0000 (19:08 -0400)
Per Rainier Vilela

src/bin/pg_dump/pg_restore.c

index 8748225976a6fb72501f3331699300d26d5545b9..24a44b81a953c8f651f0c8621f67e57f41d7c829 100644 (file)
@@ -902,12 +902,12 @@ read_one_statement(StringInfo inBuf, FILE *pfile)
            break;
        }
 
-       destroyStringInfo(&q);
-
        if (c == '\n')
            appendStringInfoChar(inBuf, (char) '\n');
    }
 
+   destroyStringInfo(&q);
+
    /* No input before EOF signal means time to quit. */
    if (c == EOF && inBuf->len == 0)
        return EOF;