]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/lua: minor code cleanup
authorVictor Julien <vjulien@oisf.net>
Sun, 19 Jan 2025 09:53:54 +0000 (10:53 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 12 Feb 2025 16:08:32 +0000 (17:08 +0100)
src/detect-lua.c

index 6fd3d891c4ee4a78fa8dbfd39a2c870619dd8d0d..b7c5c9f1b295c7ac4a1c1a096337a8b16268bc5d 100644 (file)
@@ -898,20 +898,18 @@ error:
  */
 static int DetectLuaSetup (DetectEngineCtx *de_ctx, Signature *s, const char *str)
 {
-    DetectLuaData *lua = NULL;
-
     /* First check if Lua rules are enabled, by default Lua in rules
      * is disabled. */
     int enabled = 0;
     (void)ConfGetBool("security.lua.allow-rules", &enabled);
     if (!enabled) {
         SCLogError("Lua rules disabled by security configuration: security.lua.allow-rules");
-        goto error;
+        return -1;
     }
 
-    lua = DetectLuaParse(de_ctx, str);
+    DetectLuaData *lua = DetectLuaParse(de_ctx, str);
     if (lua == NULL)
-        goto error;
+        return -1;
 
     /* Load lua sandbox configurations */
     intmax_t lua_alloc_limit = DEFAULT_LUA_ALLOC_LIMIT;