diff options
author | Thomas Vigouroux <thomas.vigouroux@protonmail.com> | 2022-06-23 09:16:05 +0200 |
---|---|---|
committer | Thomas Vigouroux <thomas.vigouroux@protonmail.com> | 2022-06-24 09:41:12 +0200 |
commit | 7add9ea0e7c144bf30525e689f1e1806a4061b89 (patch) | |
tree | cc8433fec357ec8f15c72a61af7370e95ba4efad | |
parent | 3a4fa22badc5595afc0a994ead965ff32ccf6c76 (diff) | |
download | rneovim-7add9ea0e7c144bf30525e689f1e1806a4061b89.tar.gz rneovim-7add9ea0e7c144bf30525e689f1e1806a4061b89.tar.bz2 rneovim-7add9ea0e7c144bf30525e689f1e1806a4061b89.zip |
fix(coverity/352829): correctly free memory in f_call
This function was not freeing allocated memory that it owns when calling
functions from lua.
-rw-r--r-- | src/nvim/eval/funcs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index f7d6b016fd..4fc6c587dd 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -780,6 +780,9 @@ static void f_call(typval_T *argvars, typval_T *rettv, FunPtr fptr) if (argvars[2].v_type != VAR_UNKNOWN) { if (argvars[2].v_type != VAR_DICT) { emsg(_(e_dictreq)); + if (owned) { + func_unref(func); + } return; } selfdict = argvars[2].vval.v_dict; |