diff options
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index a1321d0227..7ac51d7bd7 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -19793,7 +19793,10 @@ void ex_function(exarg_T *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) { + xfree(fp); + goto erret; + } } fp->uf_refcount = 1; fp->uf_args = newargs; |