0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.3001: Vim9: memory leak when compilation fails

Problem:    Vim9: memory leak when compilation fails.
Solution:   Free the list of variable names.
This commit is contained in:
Bram Moolenaar 2021-06-15 11:27:21 +02:00
parent 3b814af7e1
commit caf1a2f296
2 changed files with 4 additions and 0 deletions

View File

@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3001,
/**/
3000,
/**/

View File

@ -9724,8 +9724,10 @@ erret:
dfunc_T *dfunc = ((dfunc_T *)def_functions.ga_data)
+ ufunc->uf_dfunc_idx;
// Compiling aborted, free the generated instructions.
clear_instr_ga(instr);
VIM_CLEAR(dfunc->df_name);
ga_clear_strings(&dfunc->df_var_names);
// If using the last entry in the table and it was added above, we
// might as well remove it.