Hi, hackers,

During browsing the code, I found one missing PQclear in function StreamLogicalLog(). It's a very small problem as it only happens in error condition. However since another similar patch was accepted,
maybe we should also fix this one.

https://www.postgresql.org/message-id/flat/3DA7CECD-5A05-416D-8527-ABD794AEFE8B%40yesql.se#c5d662ba7bdb07e56ddbd9aaa90dea5d

Regards,
Steven
From cc87aec988c483e9118d9d31b1dad1f1ca1fb4e7 Mon Sep 17 00:00:00 2001
From: Steven Niu <niush...@gmail.com>
Date: Wed, 19 Mar 2025 13:02:18 +0800
Subject: Add missing PQclear for StreamLogicalLog function

---
 src/bin/pg_basebackup/pg_recvlogical.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/bin/pg_basebackup/pg_recvlogical.c 
b/src/bin/pg_basebackup/pg_recvlogical.c
index b9ea23e1426..b68f8b82b92 100644
--- a/src/bin/pg_basebackup/pg_recvlogical.c
+++ b/src/bin/pg_basebackup/pg_recvlogical.c
@@ -633,6 +633,7 @@ StreamLogicalLog(void)
        {
                pg_log_error("unexpected termination of replication stream: %s",
                                         PQresultErrorMessage(res));
+               PQclear(res);
                goto error;
        }
        PQclear(res);
-- 
2.43.0

Reply via email to