changeset 28253:d817abf991df v8.2.4652

patch 8.2.4652: leaking memory if assignment fails Commit: https://github.com/vim/vim/commit/d1d2684c8006105444d249e846576c23d79ad4ee Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 31 10:13:47 2022 +0100 patch 8.2.4652: leaking memory if assignment fails Problem: Leaking memory if assignment fails. Solution: Clear assigned value on failure.
author Bram Moolenaar <Bram@vim.org>
date Thu, 31 Mar 2022 11:15:03 +0200
parents f22ba39cf328
children 6c31b1126b9f
files src/version.c src/vim9execute.c
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    4652,
+/**/
     4651,
 /**/
     4650,
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -3098,6 +3098,7 @@ exec_instructions(ectx_T *ectx)
 			if (iptr->isn_type == ISN_STOREEXPORT)
 			{
 			    semsg(_(e_undefined_variable_str), name);
+			    clear_tv(STACK_TV_BOT(0));
 			    goto on_error;
 			}
 			store_var(name, STACK_TV_BOT(0));
@@ -3118,6 +3119,7 @@ exec_instructions(ectx_T *ectx)
 				{
 				    semsg(_(e_item_not_exported_in_script_str),
 									 name);
+				    clear_tv(STACK_TV_BOT(0));
 				    goto on_error;
 				}
 			    }