Skip to content

Commit 6cd9a58

Browse files
committed
Fix core dump of ispell for case of non-successfull initialization.
Previous versions aren't affected. Fix synonym dictionary init: string should be malloc'ed, not palloc'ed. Bug introduced recently while fixing lowerstr().
1 parent 8dcc8e3 commit 6cd9a58

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

contrib/tsearch2/dict_syn.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/contrib/tsearch2/dict_syn.c,v 1.10 2006/11/20 14:03:30 teodor Exp $ */
1+
/* $PostgreSQL: pgsql/contrib/tsearch2/dict_syn.c,v 1.11 2006/12/04 09:26:57 teodor Exp $ */
22

33
/*
44
* ISpell interface
@@ -132,8 +132,8 @@ syn_init(PG_FUNCTION_ARGS)
132132
continue;
133133
*end = '\0';
134134

135-
d->syn[cur].in = lowerstr(starti);
136-
d->syn[cur].out = lowerstr(starto);
135+
d->syn[cur].in = strdup(lowerstr(starti));
136+
d->syn[cur].out = strdup(lowerstr(starto));
137137
if (!(d->syn[cur].in && d->syn[cur].out))
138138
{
139139
fclose(fin);

contrib/tsearch2/ispell/spell.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,7 @@ NIFree(IspellDict * Conf)
15281528
if (Conf->Spell)
15291529
{
15301530
for (i = 0; i < Conf->nspell; i++)
1531-
pfree(Conf->Spell[i]->word);
1531+
pfree(Conf->Spell[i]);
15321532
pfree(Conf->Spell);
15331533
}
15341534

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy