From: Vsevolod Stakhov Date: Wed, 11 Mar 2015 11:57:17 +0000 (+0000) Subject: Backport fix from libucl. X-Git-Tag: 0.9.0~526 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e1aaa10d62d8ec23b6980b78fdda3fa16b1f4f3c;p=rspamd.git Backport fix from libucl. --- diff --git a/contrib/libucl/ucl_util.c b/contrib/libucl/ucl_util.c index 41e012bf1..c409e3f6f 100644 --- a/contrib/libucl/ucl_util.c +++ b/contrib/libucl/ucl_util.c @@ -917,6 +917,10 @@ ucl_include_file_single (const unsigned char *data, size_t len, } /* Restore old file vars */ + if (parser->cur_file) { + free (parser->cur_file); + } + parser->cur_file = old_curfile; DL_FOREACH_SAFE (parser->variables, cur_var, tmp_var) { if (strcmp (cur_var->var, "CURDIR") == 0 && old_curdir) { @@ -938,9 +942,6 @@ ucl_include_file_single (const unsigned char *data, size_t len, if (old_curdir) { DL_APPEND (parser->variables, old_curdir); } - if (old_curfile) { - free (old_curfile); - } parser->state = prev_state;