From 449267d03bada84395d1697722b1fda5eb797ce7 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 6 Jan 2016 17:18:53 +0000 Subject: [PATCH] Fix parsing of string lists. --- src/libserver/cfg_rcl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c index d17fa4b7b..e01d2de0b 100644 --- a/src/libserver/cfg_rcl.c +++ b/src/libserver/cfg_rcl.c @@ -2503,6 +2503,8 @@ rspamd_rcl_insert_string_list_item (gpointer *target, rspamd_mempool_t *pool, if (is_hash) { if (d.hv == NULL) { d.hv = g_hash_table_new (rspamd_str_hash, rspamd_str_equal); + rspamd_mempool_add_destructor (pool, + (rspamd_mempool_destruct_t)g_hash_table_unref, d.hv); } val = rspamd_mempool_strdup (pool, src); @@ -2586,7 +2588,8 @@ rspamd_rcl_parse_struct_string_list (rspamd_mempool_t *pool, /* Add a destructor */ - if (!is_hash) { + if (!is_hash && *target != NULL) { + *target = g_list_reverse (*target); rspamd_mempool_add_destructor (pool, (rspamd_mempool_destruct_t) g_list_free, *target); -- 2.39.5