Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6cd9a58

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. Bugintroduced recently while fixing lowerstr().
1 parent8dcc8e3 commit6cd9a58

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)

[8]ページ先頭

©2009-2025 Movatter.jp