Commit: patch 9.2.0246: memory leak in globpath()

1 view
Skip to first unread message

Christian Brabandt

unread,
Mar 25, 2026, 4:02:10 PM (15 hours ago) Mar 25
to vim...@googlegroups.com
patch 9.2.0246: memory leak in globpath()

Commit: https://github.com/vim/vim/commit/418400075ac94eb4d1caaad1cd5251d994bf2a91
Author: Huihui Huang <625...@qq.com>
Date: Wed Mar 25 19:51:42 2026 +0000

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 <625...@qq.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index 4916465e8..63757179a 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -4219,6 +4219,11 @@ globpath(
++ga->ga_len;
}
}
+ else
+ {
+ FreeWild(num_p, p);
+ p = NULL;
+ }
vim_free(p);
}
}
diff --git a/src/version.c b/src/version.c
index 9edef9b90..b38010c07 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 */
+/**/
+ 246,
/**/
245,
/**/
Reply all
Reply to author
Forward
0 new messages