]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: remove unneeded NULL check
authorPhilippe Antoine <pantoine@oisf.net>
Tue, 1 Apr 2025 19:39:11 +0000 (21:39 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 2 Apr 2025 20:36:08 +0000 (22:36 +0200)
As spotted by cppcheck

fd is set only once, and DetectFlowSetup bails early if it is NULL

Fixes: c272a646c5ae ("detect: SigMatchAppendSMToList can fail")
src/detect-flow.c

index f2de380ef554ac37951cee981a045c93941a7e36..cf267a6e0ebdc75f7a159726267b532956541396 100644 (file)
@@ -422,7 +422,7 @@ int DetectFlowSetup (DetectEngineCtx *de_ctx, Signature *s, const char *flowstr)
                     de_ctx, s, DETECT_FLOW, (SigMatchCtx *)fd, DETECT_SM_LIST_MATCH) == NULL) {
             goto error;
         }
-    } else if (fd != NULL) {
+    } else {
         DetectFlowFree(de_ctx, fd);
     }