Skip to content

Commit 4184000

Browse files
huanghuihui0904chrisbra
authored andcommitted
patch 9.2.0246: memory leak in globpath()
Problem: memory leak in globpath() Solution: Free the individual allocated strings when ga_grow() fails (Huihui Huang) closes: #19817 Signed-off-by: Huihui Huang <625173@qq.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 1578ea9 commit 4184000

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/cmdexpand.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4219,6 +4219,11 @@ globpath(
42194219
++ga->ga_len;
42204220
}
42214221
}
4222+
else
4223+
{
4224+
FreeWild(num_p, p);
4225+
p = NULL;
4226+
}
42224227
vim_free(p);
42234228
}
42244229
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
246,
737739
/**/
738740
245,
739741
/**/

0 commit comments

Comments
 (0)