# HG changeset patch # User Bram Moolenaar # Date 1653147002 -7200 # Node ID 5a34620140c0edb11c7706ac054938060b15cdb1 # Parent 4b587312c133bc088463178658ffd7f833d7582b patch 8.2.4990: memory leak when :defcompile fails Commit: https://github.com/vim/vim/commit/1a56ea8381b79c4e7697b6a05451dde5940228ea Author: Bram Moolenaar Date: Sat May 21 16:28:42 2022 +0100 patch 8.2.4990: memory leak when :defcompile fails Problem: Memory leak when :defcompile fails. Solution: Free fname when returning early. diff --git a/src/userfunc.c b/src/userfunc.c --- a/src/userfunc.c +++ b/src/userfunc.c @@ -5037,6 +5037,7 @@ find_func_by_name(char_u *name, compilet } if (!ends_excmd2(name, arg)) { + vim_free(fname); emsg(ex_errmsg(e_trailing_characters_str, arg)); return NULL; } diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4990, +/**/ 4989, /**/ 4988,