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 <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2026-05-24 09:03:59 +00:00
committed by Christian Brabandt
parent e60d4b4ff3
commit 6c8e125395
2 changed files with 4 additions and 0 deletions
+2
View 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;
}
}
+2
View File
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
525,
/**/
524,
/**/