summaryrefslogtreecommitdiff
path: root/src/backend/tsearch/spell.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/tsearch/spell.c')
-rw-r--r--src/backend/tsearch/spell.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/tsearch/spell.c b/src/backend/tsearch/spell.c
index ebc89604ac2..934be3d7d33 100644
--- a/src/backend/tsearch/spell.c
+++ b/src/backend/tsearch/spell.c
@@ -1600,7 +1600,8 @@ MergeAffix(IspellDict *Conf, int a1, int a2)
else if (*Conf->AffixData[a2] == '\0')
return a1;
- while (Conf->nAffixData + 1 >= Conf->lenAffixData)
+ /* Double the size of AffixData if there's not enough space */
+ if (Conf->nAffixData + 1 >= Conf->lenAffixData)
{
Conf->lenAffixData *= 2;
Conf->AffixData = (char **) repalloc(Conf->AffixData,