From 7add9ea0e7c144bf30525e689f1e1806a4061b89 Mon Sep 17 00:00:00 2001 From: Thomas Vigouroux Date: Thu, 23 Jun 2022 09:16:05 +0200 Subject: fix(coverity/352829): correctly free memory in f_call This function was not freeing allocated memory that it owns when calling functions from lua. --- src/nvim/eval/funcs.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- cgit