0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.2023: Vim: memory leak when :execute fails

Problem:    Vim: memory leak when :execute fails.
Solution:   Clear the growarray.
This commit is contained in:
Bram Moolenaar
2020-11-21 11:45:50 +01:00
parent 95388e3179
commit c71ee829ef
2 changed files with 8 additions and 0 deletions

View File

@@ -1200,7 +1200,10 @@ call_def_function(
}
ectx.ec_stack.ga_len -= count;
if (failed)
{
ga_clear(&ga);
goto on_error;
}
if (ga.ga_data != NULL)
{
@@ -1209,7 +1212,10 @@ call_def_function(
SOURCING_LNUM = iptr->isn_lnum;
do_cmdline_cmd((char_u *)ga.ga_data);
if (did_emsg)
{
ga_clear(&ga);
goto on_error;
}
}
else
{