aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/regexp.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-08-12 16:53:14 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-08-12 16:53:14 +0400
commit0b01a138daf4e83bd37750c7574b8c7dbef68f19 (patch)
treea9ee6975d837a86d27834e01faec9e062d50344e /src/plugins/regexp.c
parent45e3f01ca7f3487893b49ebea044ae73a1048123 (diff)
downloadrspamd-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/plugins/regexp.c')
-rw-r--r--src/plugins/regexp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c
index 008d85f39..b79997394 100644
--- a/src/plugins/regexp.c
+++ b/src/plugins/regexp.c
@@ -956,6 +956,7 @@ maybe_call_lua_function (const gchar *name, struct worker_task *task)
{
lua_State *L = task->cfg->lua_state;
struct worker_task **ptask;
+ gboolean res;
lua_getglobal (L, name);
if (lua_isfunction (L, -1)) {
@@ -967,9 +968,13 @@ maybe_call_lua_function (const gchar *name, struct worker_task *task)
msg_info ("call to %s failed: %s", (gchar *)name, lua_tostring (L, -1));
return FALSE;
}
- return lua_toboolean (L, -1);
+ res = lua_toboolean (L, -1);
+ lua_pop (L, 1);
+ return res;
+ }
+ else {
+ lua_pop (L, 1);
}
-
return FALSE;
}