]> granicus.if.org Git - php/commitdiff
fix memory leak uncovered by the pcre_extra.phpt test
authorNuno Lopes <nlopess@php.net>
Wed, 14 Jun 2006 17:52:56 +0000 (17:52 +0000)
committerNuno Lopes <nlopess@php.net>
Wed, 14 Jun 2006 17:52:56 +0000 (17:52 +0000)
ext/pcre/php_pcre.c

index f237ab700bd45fdb92d31fdf448d41a16dca3dca..58225eb09eef6ee007f987f3ed94a01316d46a90 100644 (file)
@@ -343,6 +343,9 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le
        if (re == NULL) {
                php_error_docref(NULL TSRMLS_CC,E_WARNING, "Compilation failed: %s at offset %d", error, erroffset);
                efree(pattern);
+               if (tables) {
+                       pefree((void*)tables, 1);
+               }
                return NULL;
        }