Commit: patch 9.2.0800: Memory leak in call_func() on alloc failure

3 views
Skip to first unread message

Christian Brabandt

unread,
11:00 AM (7 hours ago) 11:00 AM
to vim...@googlegroups.com
patch 9.2.0800: Memory leak in call_func() on alloc failure

Commit: https://github.com/vim/vim/commit/59271381f3a12e988aa1603eb3013f171db1594c
Author: Yasuhiro Matsumoto <matt...@gmail.com>
Date: Sat Jul 18 14:30:50 2026 +0000

patch 9.2.0800: Memory leak in call_func() on alloc failure

Problem: Memory leak in call_func() on alloc failure
Solution: goto theend for the cleanup (Yasuhiro Matsumoto).

The early return bypassed the theend cleanup, leaking the parsed generic
function type arguments. Use goto theend.

related: #20668
related: #20745

Signed-off-by: Yasuhiro Matsumoto <matt...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/userfunc.c b/src/userfunc.c
index de1a8e84e..4dddf621d 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -3997,7 +3997,7 @@ call_func(
// could be changed or deleted in the called function.
name = len > 0 ? vim_strnsave(funcname, len) : vim_strsave(funcname);
if (name == NULL)
- return ret;
+ goto theend;

fname = fname_trans_sid(name, fname_buf, &tofree, &error);
}
diff --git a/src/version.c b/src/version.c
index 0c85088f4..801fd4179 100644
--- a/src/version.c
+++ b/src/version.c
@@ -759,6 +759,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 800,
/**/
799,
/**/
Reply all
Reply to author
Forward
0 new messages