From 9df0d368c9c3a2a01808b10de124d50c63a292bb Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Tue, 11 Aug 2026 09:09:35 +1000
Subject: [PATCH v3] Remove unnecessary list_free

---
 src/backend/commands/publicationcmds.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/backend/commands/publicationcmds.c b/src/backend/commands/publicationcmds.c
index 440adb356ad..2a21917dc4c 100644
--- a/src/backend/commands/publicationcmds.c
+++ b/src/backend/commands/publicationcmds.c
@@ -1977,8 +1977,11 @@ OpenTableList(List *tables)
 		}
 	}
 
-	list_free(relids);
-	list_free(relids_with_rf);
+	/*
+	 * No need to free the Lists here -- this function runs at most once per
+	 * DDL command, and the memory will be reclaimed when that command's
+	 * context is torn down.
+	 */
 
 	return rels;
 }
-- 
2.47.3

