]> granicus.if.org Git - vim/commitdiff
patch 8.2.2907: memory leak when running out of memory v8.2.2907
authorDominique Pelle <dominique.pelle@gmail.com>
Sat, 29 May 2021 20:34:19 +0000 (22:34 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 29 May 2021 20:34:19 +0000 (22:34 +0200)
Problem:    Memory leak when running out of memory.
Solution:   Free the allocated memory. (Dominique PellĂ©, closes #8284)

src/term.c
src/version.c

index 0a4e5b758a2b4eef944123e6eca7f4679dd210b6..a91d2c73eae2bd1dc931b447e2bbf61a84ed4836 100644 (file)
@@ -4248,6 +4248,7 @@ add_termcode(char_u *name, char_u *string, int flags)
        if (new_tc == NULL)
        {
            tc_max_len -= 20;
+           vim_free(s);
            return;
        }
        for (i = 0; i < tc_len; ++i)
index d28cddd6e654761d84b34f8131fd05320c08312a..36979c89c528897667490e147dabbb5c6e29cd8e 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2907,
 /**/
     2906,
 /**/