aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2006-12-04 09:27:45 +0000
committerTeodor Sigaev <teodor@sigaev.ru>2006-12-04 09:27:45 +0000
commite72ef41d72d7555a574ff2197498f66b588bd24f (patch)
tree57e6c8199b156f98428a25c49e6b9b984d7c4d0c
parent7f676624f67f4b8590ec70f9e17f7e16e614e92e (diff)
downloadpostgresql-e72ef41d72d7555a574ff2197498f66b588bd24f.tar.gz
postgresql-e72ef41d72d7555a574ff2197498f66b588bd24f.zip
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().
-rw-r--r--contrib/tsearch2/dict_syn.c6
-rw-r--r--contrib/tsearch2/ispell/spell.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/contrib/tsearch2/dict_syn.c b/contrib/tsearch2/dict_syn.c
index cddbd473508..43ff16431f8 100644
--- a/contrib/tsearch2/dict_syn.c
+++ b/contrib/tsearch2/dict_syn.c
@@ -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);
diff --git a/contrib/tsearch2/ispell/spell.c b/contrib/tsearch2/ispell/spell.c
index 66ccca4d07c..c14012a6e73 100644
--- a/contrib/tsearch2/ispell/spell.c
+++ b/contrib/tsearch2/ispell/spell.c
@@ -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);
}