Skip to content

Commit 648240f

Browse files
huanghuihui0904chrisbra
authored andcommitted
patch 9.2.0106: memory leak in expand_findfunc()
Problem: memory leak in expand_findfunc() (after v9.1.0811) Solution: Free list variable l on early return (Huihui Huang). closes: #19564 Signed-off-by: Huihui Huang <625173@qq.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 7d1e0a7 commit 648240f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/ex_docmd.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7080,11 +7080,17 @@ expand_findfunc(char_u *pat, char_u ***files, int *numMatches)
70807080

70817081
len = list_len(l);
70827082
if (len == 0) // empty List
7083+
{
7084+
list_free(l);
70837085
return FAIL;
7086+
}
70847087

70857088
*files = ALLOC_MULT(char_u *, len);
70867089
if (*files == NULL)
7090+
{
7091+
list_free(l);
70877092
return FAIL;
7093+
}
70887094

70897095
// Copy all the List items
70907096
listitem_T *li;

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+
106,
737739
/**/
738740
105,
739741
/**/

0 commit comments

Comments
 (0)