patch 9.2.0063: memory leak in type_name_list_or_dict()
Commit:
https://github.com/vim/vim/commit/5aa0860d0a5188f35faed95088688708a749cc0c
Author: Huihui Huang <[email protected]>
Date: Thu Feb 26 20:41:11 2026 +0000
patch 9.2.0063: memory leak in type_name_list_or_dict()
Problem: memory leak in type_name_list_or_dict()
Solution: Free the variable member_free on early returns (Huihui Huang).
closes: #19513
Signed-off-by: Huihui Huang <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/version.c b/src/version.c
index dfc0431b1..3be922580 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 */
+/**/
+ 63,
/**/
62,
/**/
diff --git a/src/vim9type.c b/src/vim9type.c
index be578f26b..3d9282f60 100644
--- a/src/vim9type.c
+++ b/src/vim9type.c
@@ -2573,7 +2573,10 @@ type_name_list_or_dict(char *name, type_T *type, char
**tofree)
size_t len = STRLEN(name) + STRLEN(member_name) + 3;
*tofree = alloc(len);
if (*tofree == NULL)
+ {
+ vim_free(member_free);
return name;
+ }
vim_snprintf(*tofree, len, "%s<%s>", name, member_name);
vim_free(member_free);
--
--
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/E1vviEJ-00EZn4-La%40256bit.org.