]> granicus.if.org Git - php/commitdiff
Fixed a memory leak.
authorIlia Alshanetsky <iliaa@php.net>
Tue, 12 Nov 2002 17:41:26 +0000 (17:41 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 12 Nov 2002 17:41:26 +0000 (17:41 +0000)
ext/mbstring/mbregex.c

index ae42042f72125f109333e07146842f797f5174eb..34a0550cb4ad2b8b55177d6bcb405156c69340cf 100644 (file)
@@ -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,