diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-08-12 16:53:14 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-08-12 16:53:14 +0400 |
commit | 0b01a138daf4e83bd37750c7574b8c7dbef68f19 (patch) | |
tree | a9ee6975d837a86d27834e01faec9e062d50344e /src/lua/lua_config.c | |
parent | 45e3f01ca7f3487893b49ebea044ae73a1048123 (diff) | |
download | rspamd-0b01a138daf4e83bd37750c7574b8c7dbef68f19.tar.gz rspamd-0b01a138daf4e83bd37750c7574b8c7dbef68f19.zip |
Fix critical bug with lua stack cleaning that caused heavy memory leaks.0.4.3
Update to 0.4.3.
Diffstat (limited to 'src/lua/lua_config.c')
-rw-r--r-- | src/lua/lua_config.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c index d994d55aa..1c3017b6b 100644 --- a/src/lua/lua_config.c +++ b/src/lua/lua_config.c @@ -319,6 +319,7 @@ lua_config_function_callback (struct worker_task *task, GList *args, void *user_ if (lua_isboolean (cd->L, 1)) { res = lua_toboolean (cd->L, 1); } + lua_pop (cd->L, 1); } return res; @@ -410,7 +411,7 @@ lua_call_post_filters (struct worker_task *task) lua_setclass (cd->L, "rspamd{task}", -1); *ptask = task; - if (lua_pcall (cd->L, 1, 1, 0) != 0) { + if (lua_pcall (cd->L, 1, 0, 0) != 0) { msg_warn ("error running function %s: %s", cd->name, lua_tostring (cd->L, -1)); } cur = g_list_next (cur); @@ -535,13 +536,12 @@ lua_metric_symbol_callback (struct worker_task *task, gpointer ud) { struct lua_callback_data *cd = ud; struct worker_task **ptask; - lua_getglobal (cd->L, cd->name); ptask = lua_newuserdata (cd->L, sizeof (struct worker_task *)); lua_setclass (cd->L, "rspamd{task}", -1); *ptask = task; - if (lua_pcall (cd->L, 1, 1, 0) != 0) { + if (lua_pcall (cd->L, 1, 0, 0) != 0) { msg_warn ("error running function %s: %s", cd->name, lua_tostring (cd->L, -1)); } } |