aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-11 11:57:17 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-11 11:57:17 +0000
commite1aaa10d62d8ec23b6980b78fdda3fa16b1f4f3c (patch)
tree3f74d198ade64e39151cb199ddcf08ee8e3ac863
parent94ea1a337e014e2d6fbd81d5da184278f2ec79a3 (diff)
downloadrspamd-e1aaa10d62d8ec23b6980b78fdda3fa16b1f4f3c.tar.gz
rspamd-e1aaa10d62d8ec23b6980b78fdda3fa16b1f4f3c.zip
Backport fix from libucl.
-rw-r--r--contrib/libucl/ucl_util.c7
1 files changed, 4 insertions, 3 deletions
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;