]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0800: Memory leak in call_func() on alloc failure v9.2.0800
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Sat, 18 Jul 2026 14:30:50 +0000 (14:30 +0000)
committerChristian Brabandt <cb@256bit.org>
Sat, 18 Jul 2026 14:30:50 +0000 (14:30 +0000)
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 <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/userfunc.c
src/version.c

index de1a8e84e0fc650ec1de94451e03b0ad5b93b0b9..4dddf621d5e0945a86ea15741739378803e7dede 100644 (file)
@@ -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);
     }
index 0c85088f490836212fa95b15a1584b4578bc19a4..801fd417976beb8568e65f1dbc7d44e85458a3d6 100644 (file)
@@ -759,6 +759,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    800,
 /**/
     799,
 /**/