From: Yasuhiro Matsumoto Date: Sat, 18 Jul 2026 14:27:24 +0000 (+0000) Subject: patch 9.2.0799: Memory leak in compile_def_function_body() on alloc failure X-Git-Tag: v9.2.0799^0 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=304ccd74a502322ab8a01f8e62a595b93d6b9e6b;p=thirdparty%2Fvim.git patch 9.2.0799: Memory leak in compile_def_function_body() on alloc failure Problem: Memory leak in compile_def_function_body() on alloc failure Solution: Call vim_free with the line var (Yasuhiro Matsumoto). related: #20668 related: #20745 Signed-off-by: Yasuhiro Matsumoto Signed-off-by: Christian Brabandt --- diff --git a/src/version.c b/src/version.c index b3d1e6aed7..0c85088f49 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 */ +/**/ + 799, /**/ 798, /**/ diff --git a/src/vim9compile.c b/src/vim9compile.c index 3b1b9e9ef8..65d7580f90 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -4319,7 +4319,10 @@ compile_def_function_body( { line = vim_strsave(line); if (ga_add_string(lines_to_free, line) == FAIL) + { + vim_free(line); return FAIL; + } } }