From bc8bf865ae606cb4f256fa2c79acdabc4b669b8b Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Mon, 3 Nov 2025 11:11:53 +0530 Subject: [PATCH] detect/flowint: remove extra NULL check The fn DetectFlowintFree checks if the pointer (DetectFlowintData) passed to it is valid. So, the checks for NULL in the call sites can safely be removed. --- src/detect-flowint.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/detect-flowint.c b/src/detect-flowint.c index e1be3e3213..2cbf2c49e0 100644 --- a/src/detect-flowint.c +++ b/src/detect-flowint.c @@ -354,8 +354,6 @@ error: pcre2_substring_free((PCRE2_UCHAR *)varval); if (modstr) pcre2_substring_free((PCRE2_UCHAR *)modstr); - if (sfd != NULL) - SCFree(sfd); return NULL; } @@ -410,8 +408,7 @@ static int DetectFlowintSetup(DetectEngineCtx *de_ctx, Signature *s, const char return 0; error: - if (sfd) - DetectFlowintFree(de_ctx, sfd); + DetectFlowintFree(de_ctx, sfd); return -1; }