From af084c11ba63b71d57773cbca87df928ef300d6b Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Tue, 1 Apr 2025 21:39:11 +0200 Subject: [PATCH] detect: remove unneeded NULL check 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detect-flow.c b/src/detect-flow.c index f2de380ef5..cf267a6e0e 100644 --- a/src/detect-flow.c +++ b/src/detect-flow.c @@ -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); } -- 2.47.2