Skip to content

Commit

Permalink
patch 8.2.4652: leaking memory if assignment fails
Browse files Browse the repository at this point in the history
Problem:    Leaking memory if assignment fails.
Solution:   Clear assigned value on failure.
  • Loading branch information
brammool committed Mar 31, 2022
1 parent 1712518 commit d1d2684
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4652,
/**/
4651,
/**/
Expand Down
2 changes: 2 additions & 0 deletions src/vim9execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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;
}
}
Expand Down

0 comments on commit d1d2684

Please sign in to comment.