aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_buffer.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-05 12:42:43 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-05 12:42:43 +0000
commitb35299b4e3a6cf75cfa19783dda35411508d2913 (patch)
treeda78386cf112c62a0bf81fd04f4d243660e24f28 /src/lua/lua_buffer.c
parentf29fb4de499b145b29a1cb22b0f7c0f81473ff6b (diff)
downloadrspamd-b35299b4e3a6cf75cfa19783dda35411508d2913.tar.gz
rspamd-b35299b4e3a6cf75cfa19783dda35411508d2913.zip
Fix leaks in lua error paths
Diffstat (limited to 'src/lua/lua_buffer.c')
-rw-r--r--src/lua/lua_buffer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lua/lua_buffer.c b/src/lua/lua_buffer.c
index aaa57f9d4..c644eae7d 100644
--- a/src/lua/lua_buffer.c
+++ b/src/lua/lua_buffer.c
@@ -90,6 +90,7 @@ lua_io_read_cb (rspamd_ftok_t * in, void *arg)
if (lua_pcall (cbdata->L, 2, 1, 0) != 0) {
msg_info ("call to session finalizer failed: %s",
lua_tostring (cbdata->L, -1));
+ lua_pop (cbdata->L, 1);
}
res = lua_toboolean (cbdata->L, -1);
@@ -118,6 +119,7 @@ lua_io_write_cb (void *arg)
if (lua_pcall (cbdata->L, 1, 1, 0) != 0) {
msg_info ("call to session finalizer failed: %s",
lua_tostring (cbdata->L, -1));
+ lua_pop (cbdata->L, 1);
}
res = lua_toboolean (cbdata->L, -1);
@@ -144,6 +146,7 @@ lua_io_err_cb (GError * err, void *arg)
if (lua_pcall (cbdata->L, 2, 0, 0) != 0) {
msg_info ("call to session finalizer failed: %s",
lua_tostring (cbdata->L, -1));
+ lua_pop (cbdata->L, 1);
}
/* Unref callbacks */