diff src/vim9execute.c @ 22641:6dce588f7a46 v8.2.1869

patch 8.2.1869: Vim9: memory leak when using add() Commit: https://github.com/vim/vim/commit/955347cc7e78352a5d49540573ae958ad45e6386 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Oct 19 23:01:46 2020 +0200 patch 8.2.1869: Vim9: memory leak when using add() Problem: Vim9: memory leak when using add(). Solution: Free the added item.
author Bram Moolenaar <Bram@vim.org>
date Mon, 19 Oct 2020 23:15:03 +0200
parents 4d4042683371
children dda110a14be4
line wrap: on
line diff
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -2308,6 +2308,7 @@ call_def_function(
 		    }
 		    if (list_append_tv(l, tv2) == FAIL)
 			goto failed;
+		    clear_tv(tv2);
 		    --ectx.ec_stack.ga_len;
 		}
 		break;