]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0776: Memory leak in sign_getlist() on alloc failure v9.2.0776
authorChristian Brabandt <cb@256bit.org>
Thu, 2 Jul 2026 19:51:00 +0000 (19:51 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 2 Jul 2026 19:53:58 +0000 (19:53 +0000)
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 <cb@256bit.org>
src/sign.c
src/version.c

index a8dfd05eeecf3b4a455df26287d671cb06b57229..1d735de001460eef6feb09dafff34fde6d6276a3 100644 (file)
@@ -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);
 
index 7d9eb060fa8fe0f336531a685fd890cf9ced6d3c..1e7eba70afeba73eefa40ddd96b32365aca81540 100644 (file)
@@ -759,6 +759,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    776,
 /**/
     775,
 /**/