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>
This commit is contained in:
Huihui Huang
2026-03-25 19:51:42 +00:00
committed by Christian Brabandt
parent 1578ea9d97
commit 418400075a
2 changed files with 7 additions and 0 deletions
+5
View File
@@ -4219,6 +4219,11 @@ globpath(
++ga->ga_len;
}
}
else
{
FreeWild(num_p, p);
p = NULL;
}
vim_free(p);
}
}
+2
View File
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
246,
/**/
245,
/**/