diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-05-21 16:28:42 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-05-21 16:28:42 +0100 |
commit | 1a56ea8381b79c4e7697b6a05451dde5940228ea (patch) | |
tree | af9de0e26d2e29715939b707d4bee4d5c91586fb | |
parent | f79d9dd43f6fe05711d7e2616ab4b8bde2ccb089 (diff) | |
download | vim-git-1a56ea8381b79c4e7697b6a05451dde5940228ea.tar.gz |
patch 8.2.4990: memory leak when :defcompile failsv8.2.4990
Problem: Memory leak when :defcompile fails.
Solution: Free fname when returning early.
-rw-r--r-- | src/userfunc.c | 1 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/userfunc.c b/src/userfunc.c index 6eabd8b77..bc4bc4503 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -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; } diff --git a/src/version.c b/src/version.c index c6e6a391f..6cb825c59 100644 --- 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, |