From: Philippe Antoine Date: Tue, 1 Apr 2025 19:39:11 +0000 (+0200) Subject: detect: remove unneeded NULL check X-Git-Tag: suricata-8.0.0-beta1~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af084c11ba63b71d57773cbca87df928ef300d6b;p=thirdparty%2Fsuricata.git 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") --- 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); }