]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Plug memory leak in learning fuzzy storage
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 12 Jan 2017 14:34:36 +0000 (14:34 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 12 Jan 2017 15:06:12 +0000 (15:06 +0000)
MFH: true

src/plugins/fuzzy_check.c

index bd142084711488d5a1ecdce651ff14c877810a49..3b4f6dfff986035fa368923c6be35f4453490647 100644 (file)
@@ -2190,6 +2190,7 @@ register_fuzzy_client_call (struct rspamd_task *task,
                                errno,
                                strerror (errno));
                        rspamd_upstream_fail (selected);
+                       g_ptr_array_free (commands, TRUE);
                }
                else {
                        /* Create session for a socket */
@@ -2474,6 +2475,8 @@ fuzzy_process_handler (struct rspamd_http_connection_entry *conn_ent,
                                                commands,
                                                saved,
                                                err);
+                               rspamd_mempool_add_destructor (task->task_pool,
+                                               rspamd_ptr_array_free_hard, commands);
                                g_ptr_array_free (args, TRUE);
                        }
                        else {
@@ -2492,6 +2495,8 @@ fuzzy_process_handler (struct rspamd_http_connection_entry *conn_ent,
                                                commands,
                                                saved,
                                                err);
+                               rspamd_mempool_add_destructor (task->task_pool,
+                                               rspamd_ptr_array_free_hard, commands);
                        }
                }