aboutsummaryrefslogtreecommitdiff
path: root/contrib/pg_trgm/trgm_regexp.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pg_trgm/trgm_regexp.c')
-rw-r--r--contrib/pg_trgm/trgm_regexp.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/contrib/pg_trgm/trgm_regexp.c b/contrib/pg_trgm/trgm_regexp.c
index 7965a29c9f9..e65e6838230 100644
--- a/contrib/pg_trgm/trgm_regexp.c
+++ b/contrib/pg_trgm/trgm_regexp.c
@@ -555,15 +555,12 @@ createTrgmNFA(text *text_re, Oid collation,
{
trg = createTrgmNFAInternal(&regex, graph, rcontext);
}
- PG_CATCH();
+ PG_FINALLY();
{
pg_regfree(&regex);
- PG_RE_THROW();
}
PG_END_TRY();
- pg_regfree(&regex);
-
/* Clean up all the cruft we created */
MemoryContextSwitchTo(oldcontext);
MemoryContextDelete(tmpcontext);