diff src/scriptfile.c @ 27055:d4e7e3d82e78 v8.2.4056

patch 8.2.4056: Vim9: memory leak when exporting function in autoload script Commit: https://github.com/vim/vim/commit/6990b78f253eb7f3ebd296fd5c8353e3da1cc8f2 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 10 19:21:06 2022 +0000 patch 8.2.4056: Vim9: memory leak when exporting function in autoload script Problem: Vim9: memory leak when exporting function in autoload script. Solution: Fee the name if replacing it.
author Bram Moolenaar <Bram@vim.org>
date Mon, 10 Jan 2022 20:30:04 +0100
parents 140102677c12
children 94e38672014a
line wrap: on
line diff
--- a/src/scriptfile.c
+++ b/src/scriptfile.c
@@ -2210,6 +2210,7 @@ may_prefix_autoload(char_u *name)
 	    {
 		vim_snprintf((char *)res, len, "%s%s",
 					     si->sn_autoload_prefix, basename);
+		vim_free(name);
 		return res;
 	    }
 	}