]> granicus.if.org Git - vim/commitdiff
patch 8.2.4990: memory leak when :defcompile fails v8.2.4990
authorBram Moolenaar <Bram@vim.org>
Sat, 21 May 2022 15:28:42 +0000 (16:28 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 21 May 2022 15:28:42 +0000 (16:28 +0100)
Problem:    Memory leak when :defcompile fails.
Solution:   Free fname when returning early.

src/userfunc.c
src/version.c

index 6eabd8b77fa01088ce9c433b8a579360a7895d24..bc4bc45036ce8e7638e7142dda6f6dd86a7c9758 100644 (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;
     }
index c6e6a391f38a2c650921973d007a7f447f16357a..6cb825c59a65563f2ab22ff4328567794ebdff97 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4990,
 /**/
     4989,
 /**/