From: Vsevolod Stakhov Date: Thu, 25 Dec 2014 23:55:57 +0000 (+0000) Subject: Use safe iters for bind_socket parameter. X-Git-Tag: 0.8.0~18 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6fca6b606f22dcf04a1a9ce2a5942df82b5d89a5;p=rspamd.git Use safe iters for bind_socket parameter. --- diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c index 04726fbda..13ef400ed 100644 --- a/src/libserver/cfg_rcl.c +++ b/src/libserver/cfg_rcl.c @@ -585,8 +585,8 @@ rspamd_rcl_worker_handler (struct rspamd_config *cfg, const ucl_object_t *obj, val = ucl_object_find_key (obj, "bind_socket"); if (val != NULL) { - it = NULL; - while ((cur = ucl_iterate_object (val, &it, TRUE)) != NULL) { + it = ucl_object_iterate_new (val); + while ((cur = ucl_object_iterate_safe (it, true)) != NULL) { if (!ucl_object_tostring_safe (cur, &worker_bind)) { continue; } @@ -596,9 +596,11 @@ rspamd_rcl_worker_handler (struct rspamd_config *cfg, const ucl_object_t *obj, EINVAL, "cannot parse bind line: %s", worker_bind); + ucl_object_iterate_free (it); return FALSE; } } + ucl_object_iterate_free (it); } wrk->options = (ucl_object_t *)obj;