]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Plug memory leak in lua_tcp
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 14 Oct 2017 17:08:24 +0000 (18:08 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 14 Oct 2017 17:08:24 +0000 (18:08 +0100)
src/lua/lua_tcp.c
src/plugins/spf.c

index 1f7b2b05bfb6828f34ca713bbb9edd673c261276..6e47e98a06e3c9e1d9e068d95a6d6bba8af99e1c 100644 (file)
@@ -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);
index 097df7329eda2e6504061671881555d19aa5e569..41e952eb26bdf421faf610e5d8e9532c0f1143af 100644 (file)
@@ -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);