]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.4084: memory leak when looking for autoload prefixed variable v8.2.4084
authorBram Moolenaar <Bram@vim.org>
Thu, 13 Jan 2022 20:39:41 +0000 (20:39 +0000)
committerBram Moolenaar <Bram@vim.org>
Thu, 13 Jan 2022 20:39:41 +0000 (20:39 +0000)
Problem:    Memory leak when looking for autoload prefixed variable.
Solution:   Free the concatenated string.

src/evalvars.c
src/version.c

index 92dcd76975be6d2ee71c158a8fed2e687d0e58e2..d111b80ff806746f8b43b0311b89705a85d3a001 100644 (file)
@@ -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);
        }
     }
 
index ecfa17d4563982aa1e0c1b0a9fcb3763b7c1e8ed..957ccee0c9f60ccde1def623a40ae3d7b3b0d233 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4084,
 /**/
     4083,
 /**/