From: Vsevolod Stakhov Date: Sat, 14 Oct 2017 17:08:24 +0000 (+0100) Subject: [Fix] Plug memory leak in lua_tcp X-Git-Tag: 1.7.0~552 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a3ce6d43de5afb2b387e2a07cedab9004c4a0cb5;p=rspamd.git [Fix] Plug memory leak in lua_tcp --- diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c index 1f7b2b05b..6e47e98a0 100644 --- a/src/lua/lua_tcp.c +++ b/src/lua/lua_tcp.c @@ -333,12 +333,7 @@ lua_tcp_push_error (struct lua_tcp_cbdata *cbd, gboolean is_fatal, va_start (ap, err); for (;;) { - if (is_fatal) { - hdl = g_queue_pop_head (cbd->handlers); - } - else { - hdl = g_queue_peek_head (cbd->handlers); - } + hdl = g_queue_peek_head (cbd->handlers); if (hdl == NULL) { va_end (ap_copy); @@ -380,6 +375,9 @@ lua_tcp_push_error (struct lua_tcp_cbdata *cbd, gboolean is_fatal, /* Stop on the first callback found */ break; } + else { + lua_tcp_shift_handler (cbd); + } } va_end (ap); diff --git a/src/plugins/spf.c b/src/plugins/spf.c index 097df7329..41e952eb2 100644 --- a/src/plugins/spf.c +++ b/src/plugins/spf.c @@ -539,6 +539,7 @@ spf_plugin_callback (struct spf_resolved *record, struct rspamd_task *task, } } + spf_record_ref (l); spf_check_list (l, task); spf_record_unref (l);