diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-12-28 22:51:20 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-12-28 22:51:20 +0100 |
commit | 0107f5ba87ca9427500d0fc42ec80a1f3fca9fdb (patch) | |
tree | 23f551472a7fa74c47aeee23e01df5b003ff2e55 /src | |
parent | 40bbceee2213a6fa8fdc1d3f3920d61fb5370803 (diff) |
patch 7.4.989v7.4.989
Problem: Leaking memory when hash_add() fails. Coverity error 99126.
Solution: When hash_add() fails free the memory.
Diffstat (limited to 'src')
-rw-r--r-- | src/eval.c | 6 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index a2d2939ba2..eca8224ebf 100644 --- a/src/eval.c +++ b/src/eval.c @@ -23095,7 +23095,11 @@ ex_function(eap) /* insert the new function in the function list */ STRCPY(fp->uf_name, name); - hash_add(&func_hashtab, UF2HIKEY(fp)); + if (hash_add(&func_hashtab, UF2HIKEY(fp)) == FAIL) + { + vim_free(fp); + goto erret; + } } fp->uf_args = newargs; fp->uf_lines = newlines; diff --git a/src/version.c b/src/version.c index fcc22cd846..ddf260bbfd 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 989, +/**/ 988, /**/ 987, |