patch 9.2.0525: spell: memory leak in spell_read_dic()

Commit: 
https://github.com/vim/vim/commit/6c8e125395cc77a67c7ddb95422684ff84a54e58
Author: zeertzjq <[email protected]>
Date:   Sun May 24 09:03:59 2026 +0000

    patch 9.2.0525: spell: memory leak in spell_read_dic()
    
    Problem:  spell: memory leak in spell_read_dic() (after 9.2.0524).
    Solution: Free "pc" before breaking out of the loop (zeertzjq).
    
    closes: #20309
    
    Signed-off-by: zeertzjq <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/spellfile.c b/src/spellfile.c
index f1841ddf3..8a373f343 100644
--- a/src/spellfile.c
+++ b/src/spellfile.c
@@ -3704,6 +3704,7 @@ spell_read_dic(spellinfo_T *spin, char_u *fname, 
afffile_T *affile)
                                                                      == FAIL)
                {
                    retval = FAIL;
+                   vim_free(pc);
                    break;
                }
                pfxlen = totlen;
@@ -3717,6 +3718,7 @@ spell_read_dic(spellinfo_T *spin, char_u *fname, 
afffile_T *affile)
                                                                      == FAIL)
                {
                    retval = FAIL;
+                   vim_free(pc);
                    break;
                }
            }
diff --git a/src/version.c b/src/version.c
index f3cfeb60a..175d7ab57 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    525,
 /**/
     524,
 /**/

-- 
-- 
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/E1wR4vH-003nLi-Kf%40256bit.org.

Raspunde prin e-mail lui