]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/lua: remove extra NULL check
authorShivani Bhardwaj <shivani@oisf.net>
Mon, 3 Nov 2025 05:51:30 +0000 (11:21 +0530)
committerVictor Julien <vjulien@oisf.net>
Mon, 3 Nov 2025 18:58:23 +0000 (18:58 +0000)
The fn DetectLuaFree checks if the pointer (DetectLuaData) passed to it
is valid. So, the checks for NULL in the call sites can safely be
removed.

src/detect-lua.c

index 1700ab16deb3a3bcbcaf655eab710052604dbb0c..07aaed2d6255c7a37d360c8aee457bf92d9ce7a8 100644 (file)
@@ -482,8 +482,7 @@ static DetectLuaData *DetectLuaParse (DetectEngineCtx *de_ctx, const char *str)
     return lua;
 
 error:
-    if (lua != NULL)
-        DetectLuaFree(de_ctx, lua);
+    DetectLuaFree(de_ctx, lua);
     return NULL;
 }