Skip to content

Commit 115cb31

Browse files
committed
Fix relcache leaks in get_object_address_publication_rel()
1 parent e35bbea commit 115cb31

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/backend/catalog/objectaddress.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,7 +1835,10 @@ get_object_address_publication_rel(List *objname, List *objargs,
18351835
/* Now look up the pg_publication tuple */
18361836
pub = GetPublicationByName(pubname, missing_ok);
18371837
if (!pub)
1838+
{
1839+
relation_close(relation, AccessShareLock);
18381840
return address;
1841+
}
18391842

18401843
/* Find the publication relation mapping in syscache. */
18411844
address.objectId =
@@ -1849,6 +1852,7 @@ get_object_address_publication_rel(List *objname, List *objargs,
18491852
(errcode(ERRCODE_UNDEFINED_OBJECT),
18501853
errmsg("publication relation \"%s\" in publication \"%s\" does not exist",
18511854
RelationGetRelationName(relation), pubname)));
1855+
relation_close(relation, AccessShareLock);
18521856
return address;
18531857
}
18541858

0 commit comments

Comments
 (0)