diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-03-31 10:13:47 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-03-31 10:13:47 +0100 |
commit | d1d2684c8006105444d249e846576c23d79ad4ee (patch) | |
tree | 2f1930c5916101d224c632bcffe37889c25d4434 /src/vim9execute.c | |
parent | 1712518f4808eb0bb59c8895aa0c17c3f04572a7 (diff) | |
download | vim-git-d1d2684c8006105444d249e846576c23d79ad4ee.tar.gz |
patch 8.2.4652: leaking memory if assignment failsv8.2.4652
Problem: Leaking memory if assignment fails.
Solution: Clear assigned value on failure.
Diffstat (limited to 'src/vim9execute.c')
-rw-r--r-- | src/vim9execute.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vim9execute.c b/src/vim9execute.c index 19f5bdc76..7ff2eaf09 100644 --- 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; } } |