aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/cfg_rcl.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-06 17:18:53 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-06 17:18:53 +0000
commit449267d03bada84395d1697722b1fda5eb797ce7 (patch)
treece30da61c89ce73dcd2c32a7d0d3e8fdced29cb9 /src/libserver/cfg_rcl.c
parentb9ed71b1badf535aa989f056da56ccf8ed187b76 (diff)
downloadrspamd-449267d03bada84395d1697722b1fda5eb797ce7.tar.gz
rspamd-449267d03bada84395d1697722b1fda5eb797ce7.zip
Fix parsing of string lists.
Diffstat (limited to 'src/libserver/cfg_rcl.c')
-rw-r--r--src/libserver/cfg_rcl.c5
1 files changed, 4 insertions, 1 deletions
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);