From: Vsevolod Stakhov Date: Thu, 31 Aug 2017 20:24:49 +0000 (+0100) Subject: [Fix] Fix exceptions list in surbl X-Git-Tag: 1.6.4~18 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e2842dcfdae909f0f171b232a57d01ff75faea98;p=rspamd.git [Fix] Fix exceptions list in surbl --- diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index 999a8c1c4..a44524e70 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -154,9 +154,22 @@ read_exceptions_list (gchar * chunk, struct map_cb_data *data, gboolean final) { + GHashTable **t; + guint i; + if (data->cur_data == NULL) { + t = data->prev_data; + + for (i = 0; i < MAX_LEVELS; i++) { + if (t[i] != NULL) { + g_hash_table_destroy (t[i]); + } + t[i] = NULL; + } + data->cur_data = data->prev_data; } + return rspamd_parse_kv_list ( chunk, len, @@ -176,9 +189,12 @@ fin_exceptions_list (struct map_cb_data *data) t = data->prev_data; for (i = 0; i < MAX_LEVELS; i++) { if (t[i] != NULL) { - g_hash_table_destroy (t[i]); + rspamd_default_log_function (G_LOG_LEVEL_DEBUG, + "surbl", "", + G_STRFUNC, + "exceptions level %d: %d elements", + i, g_hash_table_size (t[i])); } - t[i] = NULL; } } }