Commit: patch 9.2.0525: spell: memory leak in spell_read_dic()

2 views
Skip to first unread message

Christian Brabandt

unread,
May 24, 2026, 5:15:14 AMMay 24
to vim...@googlegroups.com
patch 9.2.0525: spell: memory leak in spell_read_dic()

Commit: https://github.com/vim/vim/commit/6c8e125395cc77a67c7ddb95422684ff84a54e58
Author: zeertzjq <zeer...@outlook.com>
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 <zeer...@outlook.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

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,
/**/
Reply all
Reply to author
Forward
0 new messages