From b6f5c3902fea0e632439176349012d4d049f8837 Mon Sep 17 00:00:00 2001 From: Thomas Harning Jr Date: Mon, 11 Jun 2007 01:52:16 +0000 Subject: Fixed stack overflow issue. (Forgot to pop error/integer) --- luaevent/src/luaevent.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/luaevent/src/luaevent.c b/luaevent/src/luaevent.c index 120d433..286d95e 100644 --- a/luaevent/src/luaevent.c +++ b/luaevent/src/luaevent.c @@ -45,6 +45,7 @@ static void luaevent_callback(int fd, short event, void* p) { lua_pushinteger(L, event); if(lua_pcall(L, 1, 1, 0) || !lua_isnumber(L, -1)) { printf("ERROR IN CB: %s\n", lua_tostring(L, -1)); + lua_pop(L, 1); freeCallbackArgs(arg); return; } @@ -119,6 +120,7 @@ static int luaevent_addevent(lua_State* L) { /* Call the callback with all arguments after it to get the loop primed.. */ if(lua_pcall(L, top - 2, 1, 0) || !lua_isnumber(L, -1)) { printf("ERROR IN INIT: %s\n", lua_tostring(L, -1)); + lua_pop(L, 1); return 0; } ret = lua_tointeger(L, -1); -- cgit v1.2.3