]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0056: memory leak in ex_substitute v9.2.0056
authorHuihui Huang <625173@qq.com>
Wed, 25 Feb 2026 20:10:07 +0000 (20:10 +0000)
committerChristian Brabandt <cb@256bit.org>
Wed, 25 Feb 2026 20:10:07 +0000 (20:10 +0000)
Problem:  memory leak in ex_substitute
Solution: Free the variable (Huihui Huang)

fixes:  #19501
closes: #19506

Signed-off-by: Huihui Huang <625173@qq.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/ex_cmds.c
src/version.c

index b56ee268b1041142adf2326871c76a0a58581cb5..08ff731606b86690ff42b9c19b8328b6c0a65e51 100644 (file)
@@ -4130,8 +4130,11 @@ ex_substitute(exarg_T *eap)
                vim_free(old_sub);
                old_sub = vim_strsave(sub);
                if (old_sub == NULL)
+               {
                    // out of memory
+                   vim_free(sub);
                    return;
+               }
            }
        }
     }
index 40e00fc2bf31e06667d59805d5adbb503bee907b..af8e5e13edd0e44c4088bd2e923522ff6ee9dca2 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    56,
 /**/
     55,
 /**/