aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Vigouroux <thomas.vigouroux@protonmail.com>2022-06-23 09:16:05 +0200
committerThomas Vigouroux <thomas.vigouroux@protonmail.com>2022-06-24 09:41:12 +0200
commit7add9ea0e7c144bf30525e689f1e1806a4061b89 (patch)
treecc8433fec357ec8f15c72a61af7370e95ba4efad
parent3a4fa22badc5595afc0a994ead965ff32ccf6c76 (diff)
downloadrneovim-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.c3
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;