detect/lua: Unregister Lua object on free

This commit ensures that the LUA object is unregistered when the Lua
object is freed.
pull/4869/head
Jeff Lucovsky 6 years ago
parent 240c6d9f9a
commit e718ec674f

@ -687,6 +687,7 @@ static DetectLuaData *DetectLuaParse (const DetectEngineCtx *de_ctx, const char
goto error;
}
lua->de_ctx = de_ctx;
return lua;
error:
@ -1119,6 +1120,10 @@ static void DetectLuaFree(void *ptr)
if (lua->filename)
SCFree(lua->filename);
if (lua->de_ctx) {
DetectUnregisterThreadCtxFuncs((DetectEngineCtx *)lua->de_ctx, NULL, lua, "lua");
}
SCFree(lua);
}
}

@ -49,6 +49,8 @@ typedef struct DetectLuaData {
uint32_t sid;
uint32_t rev;
uint32_t gid;
const DetectEngineCtx *de_ctx;
} DetectLuaData;
#endif /* HAVE_LUA */

Loading…
Cancel
Save