patch 9.1.1852: vim9class: memory leak in parse_member()
Commit:
https://github.com/vim/vim/commit/4b9896ce9de20a83a09ccb37d884a9921d2a2529
Author: Lidong Yan <[email protected]>
Date: Sun Oct 12 15:10:09 2025 +0000
patch 9.1.1852: vim9class: memory leak in parse_member()
Problem: vim9class: fix memory leak in parse_member()
Solution: Free evalarg before returning (Lidong Yan)
In parse_member(), skip_expr_concatenate() allocates memory in evalarg.
However parse_member() forgets to free evalarg at early return-fail
point. Add clear_evalarg() at early return-fail point.
closes: #18533
Signed-off-by: Lidong Yan <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/version.c b/src/version.c
index d46906ab2..95f88fcb8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1852,
/**/
1851,
/**/
diff --git a/src/vim9class.c b/src/vim9class.c
index 09d9dffb6..d5c3615dc 100644
--- a/src/vim9class.c
+++ b/src/vim9class.c
@@ -135,6 +135,7 @@ parse_member(
if (*init_arg != NUL && !vim9_comment_start(init_arg))
{
semsg(_(e_trailing_characters_str), init_arg);
+ clear_evalarg(&evalarg, NULL);
return FAIL;
}
--
--
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/E1v7y1O-00AMuE-Eo%40256bit.org.