From: Yasuhiro Matsumoto Date: Sat, 18 Jul 2026 14:35:21 +0000 (+0000) Subject: patch 9.2.0801: Memory leak in f_getreginfo() on alloc failure X-Git-Tag: v9.2.0801^0 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e54a347396fad8137afcf3a27e4f5e187d8513d;p=thirdparty%2Fvim.git patch 9.2.0801: Memory leak in f_getreginfo() on alloc failure Problem: Memory leak in f_getreginfo() on alloc failure Solution: Call list_unref() with list var (Yasuhiro Matsumoto). Since dict_add_list() leaves ownership with the caller on failure, the freshly built list must be freed when the add fails. related: #20668 related: #20745 Signed-off-by: Yasuhiro Matsumoto Signed-off-by: Christian Brabandt --- diff --git a/src/evalfunc.c b/src/evalfunc.c index 15b1eee873..de52668e5b 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -10569,7 +10569,8 @@ f_getreginfo(typval_T *argvars, typval_T *rettv) list = (list_T *)get_reg_contents(regname, GREG_EXPR_SRC | GREG_LIST); if (list == NULL) return; - (void)dict_add_list(dict, "regcontents", list); + if (dict_add_list(dict, "regcontents", list) == FAIL) + list_unref(list); switch (get_reg_type(regname, ®len)) { diff --git a/src/version.c b/src/version.c index 801fd41797..e5eaed8d96 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 */ +/**/ + 801, /**/ 800, /**/