From: Victor Julien Date: Sun, 19 Jan 2025 09:53:54 +0000 (+0100) Subject: detect/lua: minor code cleanup X-Git-Tag: suricata-8.0.0-beta1~450 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dbd6ccd2c9c69e0fed21b088f69c05b5b01fd2e;p=thirdparty%2Fsuricata.git detect/lua: minor code cleanup --- diff --git a/src/detect-lua.c b/src/detect-lua.c index 6fd3d891c4..b7c5c9f1b2 100644 --- a/src/detect-lua.c +++ b/src/detect-lua.c @@ -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;