diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-02-20 23:07:05 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-02-20 23:07:05 +0100 |
commit | 49439c4cdf7d2822255f292adda4226656fe144d (patch) | |
tree | 2007c8f88c26e6aab7ce8d2696d57eb8637ae28f /src/eval.c | |
parent | e7877fe0de1426f8de9ada825e4f7b64810c7dbc (diff) |
patch 8.0.0344: unlet command leaks memoryv8.0.0344
Problem: Unlet command leaks memory. (Nikolai Pavlov)
Solution: Free the memory on error. (closes #1497)
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c index 3cd73b6ea3..b835af8e39 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2079,7 +2079,10 @@ get_lval( } /* existing variable, need to check if it can be changed */ else if (var_check_ro(lp->ll_di->di_flags, name, FALSE)) + { + clear_tv(&var1); return NULL; + } if (len == -1) clear_tv(&var1); |