]> granicus.if.org Git - php/commitdiff
Fixed bug #45327 (memory leak if offsetGet throws exception)
authorIlia Alshanetsky <iliaa@php.net>
Tue, 17 Feb 2009 17:09:05 +0000 (17:09 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 17 Feb 2009 17:09:05 +0000 (17:09 +0000)
# Patch by Greg

Zend/zend_object_handlers.c

index 5da47bb490088a34e084c6f817e0661551c0d2af..9fd7db1b80ab94b90a9809d44464b2b502e7f666 100644 (file)
@@ -472,6 +472,10 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type TSRMLS_DC)
                        }
                        return 0;
                }
+               if (EG(exception)) {
+                       zval_ptr_dtor(&retval);
+                       return 0;
+               }
 
                /* Undo PZVAL_LOCK() */
                retval->refcount--;