From d222bb4d5ec7cf057f318e88992c8c06d5494ca8 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Mon, 31 May 2004 13:52:57 +0000 Subject: [PATCH] Fix memory leak with pg_regcomp --- contrib/tsearch2/ispell/spell.c | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/tsearch2/ispell/spell.c b/contrib/tsearch2/ispell/spell.c index bdcbc58816..caae1fc5c7 100644 --- a/contrib/tsearch2/ispell/spell.c +++ b/contrib/tsearch2/ispell/spell.c @@ -647,6 +647,7 @@ CheckAffix(const char *word, size_t len, AFFIX * Affix, char flagflags, char *ne wmasklen = pg_mb2wchar_with_len( Affix->mask, mask, masklen); err = pg_regcomp(&(Affix->reg), mask, wmasklen, REG_EXTENDED | REG_ICASE | REG_NOSUB); + pfree(mask); if (err) { /* regerror(err, &(Affix->reg), regerrstr, ERRSTRSIZE); */