]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0797: Memory leak in get_qfline_items() on alloc failure v9.2.0797
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Sat, 18 Jul 2026 14:22:31 +0000 (14:22 +0000)
committerChristian Brabandt <cb@256bit.org>
Sat, 18 Jul 2026 14:22:31 +0000 (14:22 +0000)
Problem:  Memory leak in get_qfline_items() on alloc failure
Solution: Call dict_unref() with the dict (Yasuhiro Matsumoto).

related: #20668
related: #20745

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/quickfix.c
src/version.c

index 0c7a9c9a52bbf33965995c8cc4569e929866175a..039d37dffac3c8c8b1616bb0b05382ddb4876ef9 100644 (file)
@@ -7222,7 +7222,10 @@ get_qfline_items(qfline_T *qfp, list_T *list)
     if ((dict = dict_alloc()) == NULL)
        return FAIL;
     if (list_append_dict(list, dict) == FAIL)
+    {
+       dict_unref(dict);
        return FAIL;
+    }
 
     buf[0] = qfp->qf_type;
     buf[1] = NUL;
index 9a22bfa5194f507de8f451b68ed527ded0d945c7..a234bad44fddabee15463703abffbb3fc3bed3da 100644 (file)
@@ -759,6 +759,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    797,
 /**/
     796,
 /**/