neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 7add9ea0e7c144bf30525e689f1e1806a4061b89
parent 3a4fa22badc5595afc0a994ead965ff32ccf6c76
Author: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
Date:   Thu, 23 Jun 2022 09:16:05 +0200

fix(coverity/352829): correctly free memory in f_call

This function was not freeing allocated memory that it owns when calling
functions from lua.

Diffstat:
Msrc/nvim/eval/funcs.c | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git 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;