From: Ilia Alshanetsky Date: Tue, 12 Nov 2002 17:41:26 +0000 (+0000) Subject: Fixed a memory leak. X-Git-Tag: php-4.3.0RC1~68 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d84afe112169182ec96e495beb748b9c7ac33bfa;p=php Fixed a memory leak. --- diff --git a/ext/mbstring/mbregex.c b/ext/mbstring/mbregex.c index ae42042f72..34a0550cb4 100644 --- a/ext/mbstring/mbregex.c +++ b/ext/mbstring/mbregex.c @@ -1446,6 +1446,9 @@ re_compile_pattern(pattern, size, bufp) snprintf(error_msg, ERROR_MSG_MAX_SIZE, "invalid regular expression; there's no previous pattern, to which '%c' would define cardinality at %d", c, p-pattern); + if (bufp->buffer) { + xfree(bufp->buffer); + } FREE_AND_RETURN(stackb, error_msg); } /* If there is a sequence of repetition chars,