From: Victor Julien Date: Thu, 16 Feb 2017 14:27:09 +0000 (+0100) Subject: detect: fix missing unlock in error path X-Git-Tag: suricata-4.0.0-beta1~309 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=511e8049157bb8cc6f313b32da5cf98031437b1e;p=thirdparty%2Fsuricata.git detect: fix missing unlock in error path --- diff --git a/src/detect-engine.c b/src/detect-engine.c index db5a9d4197..8c0031b8d6 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -2004,9 +2004,10 @@ int DetectRegisterThreadCtxGlobalFuncs(const char *name, } item = SCCalloc(1, sizeof(*item)); - if (unlikely(item == NULL)) + if (unlikely(item == NULL)) { + SCMutexUnlock(&master->lock); return -1; - + } item->InitFunc = InitFunc; item->FreeFunc = FreeFunc; item->name = name;