patch 9.2.0106: memory leak in expand_findfunc()

Commit: 
https://github.com/vim/vim/commit/648240fe9a0013354a0a15777d0d5c8eb203df3d
Author: Huihui Huang <[email protected]>
Date:   Tue Mar 3 20:45:18 2026 +0000

    patch 9.2.0106: memory leak in expand_findfunc()
    
    Problem:  memory leak in expand_findfunc() (after v9.1.0811)
    Solution: Free list variable l on early return (Huihui Huang).
    
    closes: #19564
    
    Signed-off-by: Huihui Huang <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 1eb1de3e3..7dfc1d56c 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -7080,11 +7080,17 @@ expand_findfunc(char_u *pat, char_u ***files, int 
*numMatches)
 
     len = list_len(l);
     if (len == 0)          // empty List
+    {
+       list_free(l);
        return FAIL;
+    }
 
     *files = ALLOC_MULT(char_u *, len);
     if (*files == NULL)
+    {
+       list_free(l);
        return FAIL;
+    }
 
     // Copy all the List items
     listitem_T *li;
diff --git a/src/version.c b/src/version.c
index 6e93333a3..e0bf8c7c7 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 */
+/**/
+    106,
 /**/
     105,
 /**/

-- 
-- 
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/E1vxWqZ-005JCb-4R%40256bit.org.

Raspunde prin e-mail lui