mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-03 08:00:21 +08:00
Fix memory leak with pg_regexec
This commit is contained in:
parent
d222bb4d5e
commit
7cb55d21ed
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user