patch 9.2.0055: memory leak in ExpandFromContext()
Commit:
https://github.com/vim/vim/commit/9c3279ddc39da31f3fe9c52d06cb8a9b3a06ca0e
Author: Huihui Huang <[email protected]>
Date: Wed Feb 25 20:04:07 2026 +0000
patch 9.2.0055: memory leak in ExpandFromContext()
Problem: memory leak in ExpandFromContext()
Solution: Free the variable (Huihui Huang).
fixes: #19500
closes: #19505
Co-authored-by: zeertzjq <[email protected]>
Signed-off-by: Huihui Huang <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index 61cfe5bc3..4916465e8 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -3515,8 +3515,10 @@ ExpandFromContext(
{
regmatch.regprog = vim_regcomp(pat, magic_isset() ? RE_MAGIC : 0);
if (regmatch.regprog == NULL)
+ {
+ vim_free(tofree);
return FAIL;
-
+ }
// set ignore-case according to p_ic, p_scs and pat
regmatch.rm_ic = ignorecase(pat);
}
diff --git a/src/version.c b/src/version.c
index 473a64fb5..40e00fc2b 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 */
+/**/
+ 55,
/**/
54,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1vvLHj-00CurM-QW%40256bit.org.