summaryrefslogtreecommitdiffstats
path: root/src/plugins/regexp.c
diff options
context:
space:
mode:
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;
}