lua/output: access luastate within lock

Fixes Coverity issue:

CID 1648445: (#1 of 1): Data race condition (MISSING_LOCK)
4. missing_lock: Accessing td->lua_ctx->luastate without holding lock
LogLuaCtx_.m. Elsewhere, LogLuaCtx_.luastate is written to with
LogLuaCtx_.m held 41 out of 41 times.
pull/13370/head
Jason Ish 1 year ago committed by Victor Julien
parent 765041dcdd
commit e1d91497c9

@ -126,9 +126,8 @@ static int LuaStreamingLogger(ThreadVars *tv, void *thread_data, const Flow *f,
}
LogLuaThreadCtx *td = (LogLuaThreadCtx *)thread_data;
lua_State *luastate = td->lua_ctx->luastate;
SCMutexLock(&td->lua_ctx->m);
lua_State *luastate = td->lua_ctx->luastate;
LuaStateSetThreadVars(luastate, tv);
if (flags & OUTPUT_STREAMING_FLAG_TRANSACTION)

Loading…
Cancel
Save