]> source.dussan.org Git - rspamd.git/commitdiff
Fix key attributes support.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 18 Aug 2015 14:21:31 +0000 (15:21 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 18 Aug 2015 14:21:31 +0000 (15:21 +0100)
src/libserver/cfg_rcl.c

index 94817d8c683c2aab8de9d288a9d39248c37045c8..ea9dc2ab9f079a4beae96b0cb311a58f128af066 100644 (file)
@@ -1635,10 +1635,10 @@ rspamd_rcl_process_section (struct rspamd_rcl_section *sec,
        g_assert (obj != NULL);
        g_assert (sec->handler != NULL);
 
-       it = ucl_object_iterate_new (obj);
+       it = NULL;
 
        if (sec->key_attr != NULL) {
-               while ((cur = ucl_object_iterate_safe (it, false)) != NULL) {
+               while ((cur = ucl_iterate_object (obj, &it, true)) != NULL) {
                        if (ucl_object_type (cur) != UCL_OBJECT) {
                                is_nested = FALSE;
                                break;
@@ -1649,20 +1649,16 @@ rspamd_rcl_process_section (struct rspamd_rcl_section *sec,
                is_nested = FALSE;
        }
 
-       ucl_object_iterate_free (it);
-
        if (is_nested) {
                /* Just reiterate on all subobjects */
-               it = ucl_object_iterate_new (obj);
+               it = NULL;
 
-               while ((cur = ucl_object_iterate_safe (it, false)) != NULL) {
+               while ((cur = ucl_iterate_object (obj, &it, true)) != NULL) {
                        if (!sec->handler (pool, cur, ucl_object_key (cur), ptr, sec, err)) {
-                               ucl_object_iterate_free (it);
                                return FALSE;
                        }
                }
 
-               ucl_object_iterate_free (it);
                return TRUE;
        }
        else {