]> granicus.if.org Git - postgresql/blobdiff - src/backend/utils/adt/regexp.c
Prevent corner-case core dump in rfree().
[postgresql] / src / backend / utils / adt / regexp.c
index 074142e7985499f152e07ab0c4e1c1d0675c4042..92dfbb11ce61f6ea15c3c186c7ff443d0da00335 100644 (file)
@@ -187,9 +187,8 @@ RE_compile_and_cache(text *text_re, int cflags, Oid collation)
 
        if (regcomp_result != REG_OKAY)
        {
-               /* re didn't compile */
+               /* re didn't compile (no need for pg_regfree, if so) */
                pg_regerror(regcomp_result, &re_temp.cre_re, errMsg, sizeof(errMsg));
-               /* XXX should we pg_regfree here? */
                ereport(ERROR,
                                (errcode(ERRCODE_INVALID_REGULAR_EXPRESSION),
                                 errmsg("invalid regular expression: %s", errMsg)));