changeset 27110:62b88e6cd791 v8.2.4084

patch 8.2.4084: memory leak when looking for autoload prefixed variable Commit: https://github.com/vim/vim/commit/130f65d46bca94535d30cef518a6184613fb7ebf Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 13 20:39:41 2022 +0000 patch 8.2.4084: memory leak when looking for autoload prefixed variable Problem: Memory leak when looking for autoload prefixed variable. Solution: Free the concatenated string.
author Bram Moolenaar <Bram@vim.org>
date Thu, 13 Jan 2022 21:45:03 +0100
parents 59e5456e816d
children b0044a5ce6d9
files src/evalvars.c src/version.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -2889,6 +2889,7 @@ find_var(char_u *name, hashtab_T **htp, 
 	    {
 		ht = &globvarht;
 		ret = find_var_in_ht(ht, *name, auto_name, TRUE);
+		vim_free(auto_name);
 		if (ret != NULL)
 		{
 		    if (htp != NULL)
@@ -2896,7 +2897,6 @@ find_var(char_u *name, hashtab_T **htp, 
 		    return ret;
 		}
 	    }
-	    vim_free(auto_name);
 	}
     }
 
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    4084,
+/**/
     4083,
 /**/
     4082,