From 9474a22cd5480faef79f4fc7a135b064ee1f6676 Mon Sep 17 00:00:00 2001 From: alexpeshkoff Date: Thu, 9 Jul 2015 17:21:08 +0000 Subject: [PATCH] Fixed CORE-4869: Segfault when cleaning metadata cache --- src/jrd/met.epp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/jrd/met.epp b/src/jrd/met.epp index 24d656f239..b5a762f982 100644 --- a/src/jrd/met.epp +++ b/src/jrd/met.epp @@ -559,8 +559,11 @@ void MET_clear_cache(thread_db* tdbb) { MET_release_procedure_request(tdbb, procedure); - LCK_release(tdbb, procedure->prc_existence_lock); - procedure->prc_existence_lock = NULL; + if (procedure->prc_existence_lock) + { + LCK_release(tdbb, procedure->prc_existence_lock); + procedure->prc_existence_lock = NULL; + } procedure->prc_flags |= PRC_obsolete; } // Leave it in state 0 to avoid extra pass next time to clear it