]> granicus.if.org Git - php/commitdiff
Fixed memory leak on require() error
authorIlia Alshanetsky <iliaa@php.net>
Mon, 18 Sep 2006 03:29:21 +0000 (03:29 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 18 Sep 2006 03:29:21 +0000 (03:29 +0000)
main/main.c

index cc44717432b025a8246328291c82266d90caee53..aefeeb1a4bb95c4c8dc3bafd3e7353431e0a2859 100644 (file)
@@ -571,8 +571,6 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
        if (docref_buf) {
                efree(docref_buf);
        }
-       php_error(type, "%s", message);
-       efree(message);
 
        if (PG(track_errors) && module_initialized && EG(active_symbol_table)) {
                zval *tmp;
@@ -581,6 +579,9 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
                zend_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) &tmp, sizeof(zval *), NULL);
        }
        efree(buffer);
+
+       php_error(type, "%s", message);
+       efree(message);
 }
 /* }}} */