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

index daab8eec03d40947d9feb59d5d71fa0fd6820864..f95d240170a03cf0988ee4a80ff530dd2ea8d0a4 100644 (file)
@@ -1003,8 +1003,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;
        }