]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0525: spell: memory leak in spell_read_dic() v9.2.0525
authorzeertzjq <zeertzjq@outlook.com>
Sun, 24 May 2026 09:03:59 +0000 (09:03 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 24 May 2026 09:03:59 +0000 (09:03 +0000)
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 <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/spellfile.c
src/version.c

index f1841ddf373be709a4aff2939ed14398779ed643..8a373f343ff649ce5127380e1ad687160a482c0b 100644 (file)
@@ -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;
                }
            }
index f3cfeb60a84615a6b3b3cafaea48af662aebd552..175d7ab57ceb46ea507b35dde884f2373415adc3 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    525,
 /**/
     524,
 /**/