diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-03-26 15:57:43 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-03-26 15:57:43 +0000 |
commit | a5af7ff8d409b63743889c5562c7b735e19313a8 (patch) | |
tree | 19f2c2b60a455db000df12869de4bd9712bab88d /contrib/libucl/ucl_util.c | |
parent | ab4950c5eac19bd5d5aeac2a1c4772e9fd893f37 (diff) | |
download | rspamd-a5af7ff8d409b63743889c5562c7b735e19313a8.tar.gz rspamd-a5af7ff8d409b63743889c5562c7b735e19313a8.zip |
[Minor] Apply all matching special handlers
Diffstat (limited to 'contrib/libucl/ucl_util.c')
-rw-r--r-- | contrib/libucl/ucl_util.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/contrib/libucl/ucl_util.c b/contrib/libucl/ucl_util.c index 11799ab1e..6f36e5e73 100644 --- a/contrib/libucl/ucl_util.c +++ b/contrib/libucl/ucl_util.c @@ -520,18 +520,23 @@ void ucl_chunk_free (struct ucl_chunk *chunk) { if (chunk) { - if (chunk->special_handler) { - if (chunk->special_handler->free_function) { - chunk->special_handler->free_function ( - (unsigned char *) chunk->begin, - chunk->end - chunk->begin, - chunk->special_handler->user_data); + struct ucl_parser_special_handler_chain *chain, *tmp; + + LL_FOREACH_SAFE (chunk->special_handlers, chain, tmp) { + if (chain->special_handler->free_function) { + chain->special_handler->free_function ( + chain->begin, + chain->len, + chain->special_handler->user_data); } else { - UCL_FREE (chunk->end - chunk->begin, - (unsigned char *) chunk->begin); + UCL_FREE (chain->len, chain->begin); } + + UCL_FREE (sizeof (*chain), chain); } + chunk->special_handlers = NULL; + if (chunk->fname) { free (chunk->fname); } |