From d99626582c2a217abead069237958be10c701d41 Mon Sep 17 00:00:00 2001 From: Martijn Otto Date: Wed, 18 May 2016 12:52:50 +0200 Subject: Fix failing assert for Value::clone in cases where the type is not refcounted --- zend/value.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zend/value.cpp b/zend/value.cpp index 547ff85..df756c5 100644 --- a/zend/value.cpp +++ b/zend/value.cpp @@ -1146,11 +1146,12 @@ Value Value::clone() const // copy the data ZVAL_DUP(copy, _val); - // wrap it using the Value(zval*) constructor, this will +1 the refcount!!!! + // wrap it using the Value(zval*) constructor, + // this will +1 the refcount for counted values Value output(copy); // -1 the refcount to avoid future leaks - Z_DELREF_P(copy); + Z_TRY_DELREF_P(copy); // done return output; -- cgit v1.2.3