pg_basebackup: Add missing PQclear in error path
authorDaniel Gustafsson
Tue, 25 Mar 2025 16:24:23 +0000 (17:24 +0100)
committerDaniel Gustafsson
Tue, 25 Mar 2025 16:24:23 +0000 (17:24 +0100)
This adds a missing PQclear in the error path of StreamLogicalLog, a
fix in the same vein as e889422d98e with an equivalent low impact.

Author: Steven Niu 
Reviewed-by: Daniel Gustafsson
Discussion: https://postgr.es/m/c4b1c627-a3e4-4347-a670-1e28a43ce0eb@gmail.com

src/bin/pg_basebackup/pg_recvlogical.c

index a3447753119b761ec6c8bc369dbac669aaa55d82..e6158251ec181810746edbaa460e0da72428fe7f 100644 (file)
@@ -633,6 +633,7 @@ StreamLogicalLog(void)
    {
        pg_log_error("unexpected termination of replication stream: %s",
                     PQresultErrorMessage(res));
+       PQclear(res);
        goto error;
    }
    PQclear(res);