patch 9.2.0246: memory leak in globpath()

Commit: 
https://github.com/vim/vim/commit/418400075ac94eb4d1caaad1cd5251d994bf2a91
Author: Huihui Huang <[email protected]>
Date:   Wed Mar 25 19:51:42 2026 +0000

    patch 9.2.0246: memory leak in globpath()
    
    Problem:  memory leak in globpath()
    Solution: Free the individual allocated strings when ga_grow() fails
              (Huihui Huang)
    
    closes: #19817
    
    Signed-off-by: Huihui Huang <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index 4916465e8..63757179a 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -4219,6 +4219,11 @@ globpath(
                        ++ga->ga_len;
                    }
                }
+               else
+               {
+                   FreeWild(num_p, p);
+                   p = NULL;
+               }
                vim_free(p);
            }
        }
diff --git a/src/version.c b/src/version.c
index 9edef9b90..b38010c07 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 */
+/**/
+    246,
 /**/
     245,
 /**/

-- 
-- 
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/E1w5UOZ-005mbr-I6%40256bit.org.

Raspunde prin e-mail lui