patch 9.2.0056: memory leak in ex_substitute

Commit: 
https://github.com/vim/vim/commit/6a239a1905ea26eeb8f39604ab98ff374b2e0cd5
Author: Huihui Huang <[email protected]>
Date:   Wed Feb 25 20:10:07 2026 +0000

    patch 9.2.0056: memory leak in ex_substitute
    
    Problem:  memory leak in ex_substitute
    Solution: Free the variable (Huihui Huang)
    
    fixes:  #19501
    closes: #19506
    
    Signed-off-by: Huihui Huang <[email protected]>
    Signed-off-by: Hirohito Higashi <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index b56ee268b..08ff73160 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -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;
+               }
            }
        }
     }
diff --git a/src/version.c b/src/version.c
index 40e00fc2b..af8e5e13e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    56,
 /**/
     55,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1vvLHl-00Curr-7V%40256bit.org.

Raspunde prin e-mail lui