]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0065: memory leak in invoke_sync_listeners() v9.2.0065
authorHuihui Huang <625173@qq.com>
Thu, 26 Feb 2026 21:02:27 +0000 (21:02 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 26 Feb 2026 21:02:27 +0000 (21:02 +0000)
Problem:  memory leak in invoke_sync_listeners()
Solution: Free the recorded_changes on early return
          (Huihui Huang).

closes: #19516

Signed-off-by: Huihui Huang <625173@qq.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/change.c
src/version.c

index eadcfd0e24de638e63f79d6887ca12cc1888839b..451aa99a02a2ac76d9b1d819d19a7af7442aa6d8 100644 (file)
@@ -557,7 +557,10 @@ invoke_sync_listeners(
 
     dict = dict_alloc();
     if (dict == NULL)
+    {
+       list_unref(recorded_changes);
        return;
+    }
 
     dict_add_number(dict, "lnum", (varnumber_T)start);
     dict_add_number(dict, "end", (varnumber_T)end);
index 4443e6eac968cd910f9f21b0fd08d8d5449c3259..046a7e473b9d0bf71b7e9eebd7ebf0e25a97f075 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    65,
 /**/
     64,
 /**/