mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.4652: leaking memory if assignment fails
Problem: Leaking memory if assignment fails. Solution: Clear assigned value on failure.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user