From 4dbd6ccd2c9c69e0fed21b088f69c05b5b01fd2e Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sun, 19 Jan 2025 10:53:54 +0100 Subject: [PATCH] detect/lua: minor code cleanup --- src/detect-lua.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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;