From: Thierry FOURNIER Date: Mon, 21 Sep 2015 20:50:24 +0000 (+0200) Subject: MINOR: lua: reset pointer after use X-Git-Tag: v1.6-dev6~60 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a7b536b53bfd4bf5f9c8cf748411c85abdc7f92a;p=thirdparty%2Fhaproxy.git MINOR: lua: reset pointer after use After releasing the Lua environment, this patch set the only one pointer to the Lua stack to NULL. This prevents an accidental re-use. --- diff --git a/src/hlua.c b/src/hlua.c index ceeeace6e8..966ed5adb6 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -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