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

patch 8.2.4990: memory leak when :defcompile fails

Problem:    Memory leak when :defcompile fails.
Solution:   Free fname when returning early.
This commit is contained in:
Bram Moolenaar 2022-05-21 16:28:42 +01:00
parent f79d9dd43f
commit 1a56ea8381
2 changed files with 3 additions and 0 deletions

View File

@ -5037,6 +5037,7 @@ find_func_by_name(char_u *name, compiletype_T *compile_type)
}
if (!ends_excmd2(name, arg))
{
vim_free(fname);
emsg(ex_errmsg(e_trailing_characters_str, arg));
return NULL;
}

View File

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