Commit: patch 9.2.0797: Memory leak in get_qfline_items() on alloc failure

0 views
Skip to first unread message

Christian Brabandt

unread,
11:00 AM (7 hours ago) 11:00 AM
to vim...@googlegroups.com
patch 9.2.0797: Memory leak in get_qfline_items() on alloc failure

Commit: https://github.com/vim/vim/commit/67304a7e10a007b84654129fb4640f03c4d9ac7d
Author: Yasuhiro Matsumoto <matt...@gmail.com>
Date: Sat Jul 18 14:22:31 2026 +0000

patch 9.2.0797: Memory leak in get_qfline_items() on alloc failure

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 <matt...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/quickfix.c b/src/quickfix.c
index 0c7a9c9a5..039d37dff 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -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;
diff --git a/src/version.c b/src/version.c
index 9a22bfa51..a234bad44 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 */
+/**/
+ 797,
/**/
796,
/**/
Reply all
Reply to author
Forward
0 new messages