1
0
forked from aniani/vim

patch 8.2.2907: memory leak when running out of memory

Problem:    Memory leak when running out of memory.
Solution:   Free the allocated memory. (Dominique Pellé, closes #8284)
This commit is contained in:
Dominique Pelle
2021-05-29 22:34:19 +02:00
committed by Bram Moolenaar
parent a5787c3742
commit 28cf44f761
2 changed files with 3 additions and 0 deletions

View File

@@ -4248,6 +4248,7 @@ add_termcode(char_u *name, char_u *string, int flags)
if (new_tc == NULL) if (new_tc == NULL)
{ {
tc_max_len -= 20; tc_max_len -= 20;
vim_free(s);
return; return;
} }
for (i = 0; i < tc_len; ++i) for (i = 0; i < tc_len; ++i)

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
2907,
/**/ /**/
2906, 2906,
/**/ /**/