From 8bb3354f1868ceb945cbfa7f6713c2bbfbf871d6 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Thu, 10 Feb 2022 10:59:35 +1100 Subject: [PATCH v1] Remove unreachable code in GetRelationPublicationActions. When the 'relation->rd_pubactions' is not NULL then the function unconditionally returns early (near the top). Therefore, some later code seems unreachable because 'rd_pubactions' can never be not NULL here. This patch removes the unreachable code. --- src/backend/utils/cache/relcache.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 2707fed..a585aca 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -5598,12 +5598,6 @@ GetRelationPublicationActions(Relation relation) break; } - if (relation->rd_pubactions) - { - pfree(relation->rd_pubactions); - relation->rd_pubactions = NULL; - } - /* Now save copy of the actions in the relcache entry. */ oldcxt = MemoryContextSwitchTo(CacheMemoryContext); relation->rd_pubactions = palloc(sizeof(PublicationActions)); -- 1.8.3.1