]> source.dussan.org Git - 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 14:34:36 +0000 (14:34 +0000)
MFH: true

src/plugins/fuzzy_check.c

index 79de7bfe94d1ea5b53bd6d5ddb3afea7f87d9dfb..955d6fd860259f816800710d50f95300b302cb31 100644 (file)
@@ -2359,6 +2359,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 */
@@ -2631,6 +2632,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 {
@@ -2649,6 +2652,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);
                        }
                }