Revert "Fix memory leak when dereferencing reference with refcount 1"

This reverts commit f4cb5cc09d.

breaks tests Zend/tests/bug27268.phpt and Zend/tests/bug68262.phpt
This commit is contained in:
Xinchen Hui 2015-01-05 00:26:10 -05:00
parent 28985e982b
commit 7aab9659ee

View file

@ -205,9 +205,7 @@ ZEND_API void zval_add_ref(zval *p)
{
if (Z_REFCOUNTED_P(p)) {
if (Z_ISREF_P(p) && Z_REFCOUNT_P(p) == 1) {
zend_reference *ref = Z_REF_P(p);
ZVAL_COPY(p, Z_REFVAL_P(p));
efree(ref);
} else {
Z_ADDREF_P(p);
}