aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-17 10:37:50 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-17 10:37:50 +0100
commit4f2b2d824f7c8d3d0d02dc995c81213d7a5c8026 (patch)
treee0576925dbf9a1342de5d8ebd69ddfe3333ffdd0
parent9941fa51938c08c353eb48b2dfcdcc9e45271934 (diff)
downloadrspamd-4f2b2d824f7c8d3d0d02dc995c81213d7a5c8026.tar.gz
rspamd-4f2b2d824f7c8d3d0d02dc995c81213d7a5c8026.zip
[Minor] Libucl: Backport fixes
-rw-r--r--contrib/libucl/ucl_parser.c9
1 files changed, 6 insertions, 3 deletions
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);
+ }
}
}