]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: lua: reset pointer after use
authorThierry FOURNIER <tfournier@arpalert.org>
Mon, 21 Sep 2015 20:50:24 +0000 (22:50 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 25 Sep 2015 21:40:02 +0000 (23:40 +0200)
After releasing the Lua environment, this patch set the only one pointer to
the Lua stack to NULL. This prevents an accidental re-use.

src/hlua.c

index ceeeace6e841d2addccbf30f9cf1608af9035a07..966ed5adb6980ae2489977bab1d81f29f824ee7f 100644 (file)
@@ -907,6 +907,7 @@ void hlua_ctx_destroy(struct hlua *lua)
        /* The thread is garbage collected by Lua. */
        luaL_unref(lua->T, LUA_REGISTRYINDEX, lua->Mref);
        luaL_unref(gL.T, LUA_REGISTRYINDEX, lua->Tref);
+       lua->T = NULL;
 }
 
 /* This function is used to restore the Lua context when a coroutine