]> granicus.if.org Git - php/commitdiff
fix leak in preg_split()
authorAntony Dovgal <tony2001@php.net>
Tue, 19 Sep 2006 11:48:59 +0000 (11:48 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 19 Sep 2006 11:48:59 +0000 (11:48 +0000)
ext/pcre/php_pcre.c

index 6854106ca61402375f84f9e57ab5f85ec72ebcf1..de6853ce5f51bfab4e04476c98ad9ade10e4e488 100644 (file)
@@ -1485,11 +1485,11 @@ PHP_FUNCTION(preg_split)
 
        /* Compile regex or get it from cache. */
        if ((pce = pcre_get_compiled_regex_cache(regex.s, regex_len TSRMLS_CC)) == NULL) {
-               RETURN_FALSE;
                if (str_type == IS_UNICODE) {
                        efree(regex_utf8);
                        efree(subject_utf8);
                }
+               RETURN_FALSE;
        }
 
        php_pcre_split_impl(pce, subject.s, subject_len, return_value, limit_val, flags TSRMLS_CC);