aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Harning Jr <harningt@gmail.com>2007-06-11 01:52:16 +0000
committerThomas Harning Jr <harningt@gmail.com>2007-06-11 01:52:16 +0000
commitb6f5c3902fea0e632439176349012d4d049f8837 (patch)
treefb3de681cef73312dec9346e149e373eb0c6dc40
parentc5e71fedaad9115c235f5b72f6a3894da264d18d (diff)
downloadluaevent-prosody-b6f5c3902fea0e632439176349012d4d049f8837.tar.gz
luaevent-prosody-b6f5c3902fea0e632439176349012d4d049f8837.zip
Fixed stack overflow issue. (Forgot to pop error/integer)
-rw-r--r--luaevent/src/luaevent.c2
1 files changed, 2 insertions, 0 deletions
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);