summaryrefslogtreecommitdiff
path: root/ext/mbstring/mbregex.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2002-11-12 17:41:26 +0000
committerIlia Alshanetsky <iliaa@php.net>2002-11-12 17:41:26 +0000
commitd84afe112169182ec96e495beb748b9c7ac33bfa (patch)
treebf5efda664cc4b961bfa80c62a3c3ac3d856e4d9 /ext/mbstring/mbregex.c
parent0f2ae50178dcfc84d7483a2a6f1989a365417586 (diff)
downloadphp-git-d84afe112169182ec96e495beb748b9c7ac33bfa.tar.gz
Fixed a memory leak.
Diffstat (limited to 'ext/mbstring/mbregex.c')
-rw-r--r--ext/mbstring/mbregex.c3
1 files changed, 3 insertions, 0 deletions
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,