From 130f65d46bca94535d30cef518a6184613fb7ebf Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 13 Jan 2022 20:39:41 +0000 Subject: [PATCH] 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. --- src/evalvars.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/evalvars.c b/src/evalvars.c index 92dcd76975..d111b80ff8 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -2889,6 +2889,7 @@ find_var(char_u *name, hashtab_T **htp, int no_autoload) { 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, int no_autoload) return ret; } } - vim_free(auto_name); } } diff --git a/src/version.c b/src/version.c index ecfa17d456..957ccee0c9 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 4084, /**/ 4083, /**/