From: Vsevolod Stakhov Date: Fri, 17 Apr 2020 09:37:50 +0000 (+0100) Subject: [Minor] Libucl: Backport fixes X-Git-Tag: 2.6~518 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4f2b2d824f7c8d3d0d02dc995c81213d7a5c8026;p=rspamd.git [Minor] Libucl: Backport fixes --- diff --git a/contrib/libucl/ucl_parser.c b/contrib/libucl/ucl_parser.c index b048f426a..5b5681863 100644 --- a/contrib/libucl/ucl_parser.c +++ b/contrib/libucl/ucl_parser.c @@ -461,12 +461,15 @@ ucl_expand_single_variable (struct ucl_parser *parser, const char *ptr, } if (!found) { if (strict && parser->var_handler != NULL) { - if (parser->var_handler (ptr, remain, &dst, &dstlen, &need_free, + if (parser->var_handler (p, remain, &dst, &dstlen, &need_free, parser->var_data)) { memcpy (d, dst, dstlen); - ret += dstlen; - d += remain; + ret += remain; + d += dstlen; found = true; + if (need_free) { + free (dst); + } } }