diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-01-17 19:19:34 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-01-17 19:19:34 +0000 |
commit | 6eec897d8c3e01159556f41b8bb938cacfc0c084 (patch) | |
tree | f504c1b2d9fde36cab3673c6c4f66f125ef152e2 /contrib/libucl | |
parent | e5da64bb8b631130fb2b2859d0b7034a14a46ce0 (diff) | |
download | rspamd-6eec897d8c3e01159556f41b8bb938cacfc0c084.tar.gz rspamd-6eec897d8c3e01159556f41b8bb938cacfc0c084.zip |
[Fix] More fixes for iterators cleanup
Diffstat (limited to 'contrib/libucl')
-rw-r--r-- | contrib/libucl/ucl_util.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/libucl/ucl_util.c b/contrib/libucl/ucl_util.c index a26d4748d..7fcfe2e6e 100644 --- a/contrib/libucl/ucl_util.c +++ b/contrib/libucl/ucl_util.c @@ -2470,6 +2470,10 @@ ucl_object_iterate_reset (ucl_object_iter_t it, const ucl_object_t *obj) UCL_SAFE_ITER_CHECK (rit); + if (rit->expl_it != NULL) { + UCL_FREE (sizeof (*rit->expl_it), rit->expl_it); + } + rit->impl_it = obj; rit->expl_it = NULL; @@ -2501,12 +2505,8 @@ ucl_object_iterate_full (ucl_object_iter_t it, enum ucl_iterate_type type) if (ret == NULL && (type & UCL_ITERATE_IMPLICIT)) { /* Need to switch to another implicit object in chain */ rit->impl_it = rit->impl_it->next; - - if (rit->expl_it != NULL) { - UCL_FREE (sizeof (*rit->expl_it), rit->expl_it); - } - rit->expl_it = NULL; + return ucl_object_iterate_safe (it, type); } } |