]> source.dussan.org Git - rspamd.git/commitdiff
Fix parsing of string lists.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 6 Jan 2016 17:18:53 +0000 (17:18 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 6 Jan 2016 17:18:53 +0000 (17:18 +0000)
src/libserver/cfg_rcl.c

index d17fa4b7b85e6f43aad3c18836c3871f01b14534..e01d2de0b8c4a6454fcd78b325a01b7f04994c91 100644 (file)
@@ -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);