Commit: patch 9.2.0776: Memory leak in sign_getlist() on alloc failure

1 view
Skip to first unread message

Christian Brabandt

unread,
Jul 2, 2026, 4:15:24 PM (8 hours ago) Jul 2
to vim...@googlegroups.com
patch 9.2.0776: Memory leak in sign_getlist() on alloc failure

Commit: https://github.com/vim/vim/commit/fe132bb249e79d03a47e85cb5112f5b2070f206a
Author: Christian Brabandt <c...@256bit.org>
Date: Thu Jul 2 19:51:00 2026 +0000

patch 9.2.0776: Memory leak in sign_getlist() on alloc failure

Problem: Memory leak in sign_getlist() on allocation failure
(Ao Xijie)
Solution: Call dict_unref() on failure to free the previously
allocated dict.

related: #20668

Supported by AI.

Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/sign.c b/src/sign.c
index a8dfd05ee..1d735de00 100644
--- a/src/sign.c
+++ b/src/sign.c
@@ -1838,7 +1838,10 @@ sign_getlist(char_u *name, list_T *retlist)
return;

if (list_append_dict(retlist, dict) == FAIL)
+ {
+ dict_unref(dict);
return;
+ }

sign_getinfo(sp, dict);

diff --git a/src/version.c b/src/version.c
index 7d9eb060f..1e7eba70a 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 */
+/**/
+ 776,
/**/
775,
/**/
Reply all
Reply to author
Forward
0 new messages