mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-11-27 07:21:09 +08:00
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().
This commit is contained in:
parent
7f676624f6
commit
e72ef41d72
@ -1,4 +1,4 @@
|
||||
/* $PostgreSQL: pgsql/contrib/tsearch2/dict_syn.c,v 1.10 2006/11/20 14:03:30 teodor Exp $ */
|
||||
/* $PostgreSQL: pgsql/contrib/tsearch2/dict_syn.c,v 1.10.2.1 2006/12/04 09:27:44 teodor Exp $ */
|
||||
|
||||
/*
|
||||
* ISpell interface
|
||||
@ -132,8 +132,8 @@ syn_init(PG_FUNCTION_ARGS)
|
||||
continue;
|
||||
*end = '\0';
|
||||
|
||||
d->syn[cur].in = lowerstr(starti);
|
||||
d->syn[cur].out = lowerstr(starto);
|
||||
d->syn[cur].in = strdup(lowerstr(starti));
|
||||
d->syn[cur].out = strdup(lowerstr(starto));
|
||||
if (!(d->syn[cur].in && d->syn[cur].out))
|
||||
{
|
||||
fclose(fin);
|
||||
|
@ -1528,7 +1528,7 @@ NIFree(IspellDict * Conf)
|
||||
if (Conf->Spell)
|
||||
{
|
||||
for (i = 0; i < Conf->nspell; i++)
|
||||
pfree(Conf->Spell[i]->word);
|
||||
pfree(Conf->Spell[i]);
|
||||
pfree(Conf->Spell);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user