diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-05 12:42:43 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-05 12:42:43 +0000 |
commit | b35299b4e3a6cf75cfa19783dda35411508d2913 (patch) | |
tree | da78386cf112c62a0bf81fd04f4d243660e24f28 /src/lua/lua_buffer.c | |
parent | f29fb4de499b145b29a1cb22b0f7c0f81473ff6b (diff) | |
download | rspamd-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.c | 3 |
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 */ |