patch 9.2.0106: memory leak in expand_findfunc()
Commit:
https://github.com/vim/vim/commit/648240fe9a0013354a0a15777d0d5c8eb203df3d
Author: Huihui Huang <
625...@qq.com>
Date: Tue Mar 3 20:45:18 2026 +0000
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 <
625...@qq.com>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 1eb1de3e3..7dfc1d56c 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -7080,11 +7080,17 @@ expand_findfunc(char_u *pat, char_u ***files, int *numMatches)
len = list_len(l);
if (len == 0) // empty List
+ {
+ list_free(l);
return FAIL;
+ }
*files = ALLOC_MULT(char_u *, len);
if (*files == NULL)
+ {
+ list_free(l);
return FAIL;
+ }
// Copy all the List items
listitem_T *li;
diff --git a/src/version.c b/src/version.c
index 6e93333a3..e0bf8c7c7 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 106,
/**/
105,
/**/