projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d222bb4
)
Fix memory leak with pg_regexec
author
Teodor Sigaev
<teodor@sigaev.ru>
Mon, 31 May 2004 13:55:19 +0000
(13:55 +0000)
committer
Teodor Sigaev
<teodor@sigaev.ru>
Mon, 31 May 2004 13:55:19 +0000
(13:55 +0000)
contrib/tsearch2/ispell/spell.c
patch
|
blob
|
blame
|
history
diff --git
a/contrib/tsearch2/ispell/spell.c
b/contrib/tsearch2/ispell/spell.c
index caae1fc5c709b4334308555240a8a8005ac9b688..fa62473895971e724e3c325d3a7a2af8de4a603b 100644
(file)
--- a/
contrib/tsearch2/ispell/spell.c
+++ b/
contrib/tsearch2/ispell/spell.c
@@
-662,8
+662,11
@@
CheckAffix(const char *word, size_t len, AFFIX * Affix, char flagflags, char *ne
data = (pg_wchar *) palloc((dat_len + 1) * sizeof(pg_wchar));
data_len = pg_mb2wchar_with_len(newword, data, dat_len);
- if (!(err = pg_regexec(&(Affix->reg), data,dat_len,NULL, 1, subs, 0)))
+ if (!(err = pg_regexec(&(Affix->reg), data,dat_len,NULL, 1, subs, 0))) {
+ pfree(data);
return newword;
+ }
+ pfree(data);
return NULL;
}