diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-03-19 14:22:11 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-03-19 14:22:11 +0100 |
commit | 9f6154f26ef17b0a7efd2fcdd79cabfe510f28b4 (patch) | |
tree | 81efa8134521e60f78a6ff1e0b09e9d77f85d4a0 /src/eval.c | |
parent | ba8cd122ef60a7c71a7723be0d635f0c2d4556ab (diff) |
patch 7.4.1597v7.4.1597
Problem: Memory leak when out of memory. (Coverity)
Solution: Free the name.
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index 5fc4bd4ff3..a2288f9f27 100644 --- a/src/eval.c +++ b/src/eval.c @@ -11904,7 +11904,9 @@ f_function(typval_T *argvars, typval_T *rettv) partial_T *pt = (partial_T *)alloc_clear(sizeof(partial_T)); /* result is a VAR_PARTIAL */ - if (pt != NULL) + if (pt == NULL) + vim_free(name); + else { if (arg_idx > 0 || (arg_pt != NULL && arg_pt->pt_argc > 0)) { |