0002-Fix-memory-leak-of-primary_sysid-in-walreceiver.patch

text/x-patch

Filename: 0002-Fix-memory-leak-of-primary_sysid-in-walreceiver.patch
Type: text/x-patch
Part: 0
Message: [PATCH] Fix memory leak of primary_sysid in walreceiver

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
Series: patch 0002
File+
src/backend/replication/walreceiver.c 1 0
diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c
index 23fce948967..8dbfaffaa9a 100644
--- a/src/backend/replication/walreceiver.c
+++ b/src/backend/replication/walreceiver.c
@@ -327,6 +327,7 @@ WalReceiverMain(const void *startup_data, size_t startup_data_len)
 					 errdetail("The primary's identifier is %s, the standby's identifier is %s.",
 							   primary_sysid, standby_sysid)));
 		}
+		pfree(primary_sysid);
 
 		/*
 		 * Confirm that the current timeline of the primary is the same or