Commit 115cb315 authored by Peter Eisentraut's avatar Peter Eisentraut

Fix relcache leaks in get_object_address_publication_rel()

parent e35bbea7
...@@ -1835,7 +1835,10 @@ get_object_address_publication_rel(List *objname, List *objargs, ...@@ -1835,7 +1835,10 @@ get_object_address_publication_rel(List *objname, List *objargs,
/* Now look up the pg_publication tuple */ /* Now look up the pg_publication tuple */
pub = GetPublicationByName(pubname, missing_ok); pub = GetPublicationByName(pubname, missing_ok);
if (!pub) if (!pub)
{
relation_close(relation, AccessShareLock);
return address; return address;
}
/* Find the publication relation mapping in syscache. */ /* Find the publication relation mapping in syscache. */
address.objectId = address.objectId =
...@@ -1849,6 +1852,7 @@ get_object_address_publication_rel(List *objname, List *objargs, ...@@ -1849,6 +1852,7 @@ get_object_address_publication_rel(List *objname, List *objargs,
(errcode(ERRCODE_UNDEFINED_OBJECT), (errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("publication relation \"%s\" in publication \"%s\" does not exist", errmsg("publication relation \"%s\" in publication \"%s\" does not exist",
RelationGetRelationName(relation), pubname))); RelationGetRelationName(relation), pubname)));
relation_close(relation, AccessShareLock);
return address; return address;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment