]> granicus.if.org Git - php/commitdiff
fix leak
authorStanislav Malyshev <stas@php.net>
Sun, 22 May 2005 11:11:42 +0000 (11:11 +0000)
committerStanislav Malyshev <stas@php.net>
Sun, 22 May 2005 11:11:42 +0000 (11:11 +0000)
Zend/zend.c

index 825715ea4f2aa607e452be259a1fa10b82be54fd..941ccbf44848698b5acafc97196fd2cd944bb695 100644 (file)
@@ -1019,8 +1019,11 @@ ZEND_API void zend_error(int type, const char *format, ...)
                        zval_ptr_dtor(&z_error_type);
                        zval_ptr_dtor(&z_error_filename);
                        zval_ptr_dtor(&z_error_lineno);
-                       if (ZVAL_REFCOUNT(z_context) == 2) {
+                       if (ZVAL_REFCOUNT(z_context) <= 2) {
                                FREE_ZVAL(z_context);
+                       } else {
+                               ZVAL_DELREF(z_context);
+                               zval_ptr_dtor(&z_context);
                        }
                        break;
        }