]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: fix missing unlock in error path
authorVictor Julien <victor@inliniac.net>
Thu, 16 Feb 2017 14:27:09 +0000 (15:27 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 17 Feb 2017 11:36:18 +0000 (12:36 +0100)
src/detect-engine.c

index db5a9d4197e4bbed221f99f22972c3cb1c1df027..8c0031b8d66d0e03e7d3d058fa5acd7c88d53e17 100644 (file)
@@ -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;