From 71339c459ef5d137e6b96f078b68d12ace5dcedb Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Mon, 3 Nov 2025 11:14:26 +0530 Subject: [PATCH] detect/flowvar: remove extra NULL check The fn DetectFlowvarDataFree checks if the pointer (DetectFlowvarData) passed to it is valid. So, the checks for NULL in the call sites can safely be removed. --- src/detect-flowvar.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/detect-flowvar.c b/src/detect-flowvar.c index a3e8279cf0..f940b76b6a 100644 --- a/src/detect-flowvar.c +++ b/src/detect-flowvar.c @@ -192,8 +192,7 @@ static int DetectFlowvarSetup (DetectEngineCtx *de_ctx, Signature *s, const char return 0; error: - if (fd != NULL) - DetectFlowvarDataFree(de_ctx, fd); + DetectFlowvarDataFree(de_ctx, fd); if (content != NULL) SCFree(content); return -1; @@ -272,8 +271,7 @@ int DetectFlowvarPostMatchSetup(DetectEngineCtx *de_ctx, Signature *s, uint32_t } return 0; error: - if (fv != NULL) - DetectFlowvarDataFree(de_ctx, fv); + DetectFlowvarDataFree(de_ctx, fv); return -1; }