0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.3951: Vim9: memory leak when text after a nested function

Problem:    Vim9: memory leak when text after a nested function.
Solution:   Free the function if text is found after "enddef".
This commit is contained in:
Bram Moolenaar
2021-12-30 17:09:05 +00:00
parent 94f3192b03
commit d293981d2b
3 changed files with 17 additions and 3 deletions

View File

@@ -889,6 +889,7 @@ compile_nested_function(exarg_T *eap, cctx_T *cctx, char_u **line_to_free)
semsg(_(e_text_found_after_str_str),
eap->cmdidx == CMD_def ? "enddef" : "endfunction", eap->nextcmd);
r = FAIL;
func_ptr_unref(ufunc);
goto theend;
}