]> granicus.if.org Git - php/commitdiff
fix leak appearing when __autoload() throws an exception
authorAntony Dovgal <tony2001@php.net>
Tue, 20 Dec 2005 11:25:34 +0000 (11:25 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 20 Dec 2005 11:25:34 +0000 (11:25 +0000)
Zend/zend_execute_API.c

index 4618d7b85e8dbbd691b59d360e7fe984324ab5ce..76246434123cd08328823459b4aad1755e3fa74f 100644 (file)
@@ -947,7 +947,7 @@ ZEND_API int zend_lookup_class_ex(char *name, int name_length, int use_autoload,
        zval **args[1];
        zval autoload_function;
        zval *class_name_ptr;
-       zval *retval_ptr;
+       zval *retval_ptr = NULL;
        int retval;
        char *lc_name;
        zval *exception;
@@ -1030,6 +1030,8 @@ ZEND_API int zend_lookup_class_ex(char *name, int name_length, int use_autoload,
        }
        if (!EG(exception)) {
                EG(exception) = exception;
+       }
+       if (retval_ptr) {
                zval_ptr_dtor(&retval_ptr);
        }