Repository: incubator-hawq Updated Branches: refs/heads/master 713fc02bc -> fecebeade
HAWQ-1149. Fixed relcache reference leak when pg_class tuple is invalid Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/fecebead Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/fecebead Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/fecebead Branch: refs/heads/master Commit: fecebeadeca5ddd6700c6d964e8835d2f28901a3 Parents: 713fc02 Author: Ming LI <[email protected]> Authored: Fri Nov 25 16:35:13 2016 +0800 Committer: Ming LI <[email protected]> Committed: Fri Nov 25 16:52:41 2016 +0800 ---------------------------------------------------------------------- src/backend/utils/cache/relcache.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/fecebead/src/backend/utils/cache/relcache.c ---------------------------------------------------------------------- diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index f2d17d5..93ac2b5 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -1211,9 +1211,11 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) /* * if no such tuple exists, return NULL */ - if (!HeapTupleIsValid(pg_class_tuple)) + if (!HeapTupleIsValid(pg_class_tuple)){ + if(RelationIsValid(pg_class_relation)) + heap_close(pg_class_relation, AccessShareLock); return NULL; - + } /* * get information from the pg_class_tuple */
