From ac8b7b8aaf0dabdabb230cf9aaec8374e822527a Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 4 Jan 2025 17:18:53 +0100 Subject: [PATCH] Fix wrong comment and use cheaper destruction macro (#17359) --- ext/standard/user_filters.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index fcbc09c645882..534298592e402 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -357,8 +357,8 @@ PHP_FUNCTION(stream_bucket_make_writeable) ZVAL_RES(&zbucket, zend_register_resource(bucket, le_bucket)); object_init_ex(return_value, stream_bucket_class_entry); zend_update_property(Z_OBJCE_P(return_value), Z_OBJ_P(return_value), ZEND_STRL("bucket"), &zbucket); - /* add_property_zval increments the refcount which is unwanted here */ - zval_ptr_dtor(&zbucket); + /* zend_update_property increments the refcount which is unwanted here */ + Z_DELREF(zbucket); zend_update_property_stringl(Z_OBJCE_P(return_value), Z_OBJ_P(return_value), ZEND_STRL("data"), bucket->buf, bucket->buflen); zend_update_property_long(Z_OBJCE_P(return_value), Z_OBJ_P(return_value), ZEND_STRL("datalen"), bucket->buflen); zend_update_property_long(Z_OBJCE_P(return_value), Z_OBJ_P(return_value), ZEND_STRL("dataLength"), bucket->buflen); @@ -461,8 +461,8 @@ PHP_FUNCTION(stream_bucket_new) ZVAL_RES(&zbucket, zend_register_resource(bucket, le_bucket)); object_init_ex(return_value, stream_bucket_class_entry); zend_update_property(Z_OBJCE_P(return_value), Z_OBJ_P(return_value), ZEND_STRL("bucket"), &zbucket); - /* add_property_zval increments the refcount which is unwanted here */ - zval_ptr_dtor(&zbucket); + /* zend_update_property increments the refcount which is unwanted here */ + Z_DELREF(zbucket); zend_update_property_stringl(Z_OBJCE_P(return_value), Z_OBJ_P(return_value), ZEND_STRL("data"), bucket->buf, bucket->buflen); zend_update_property_long(Z_OBJCE_P(return_value), Z_OBJ_P(return_value), ZEND_STRL("datalen"), bucket->buflen); zend_update_property_long(Z_OBJCE_P(return_value), Z_OBJ_P(return_value), ZEND_STRL("dataLength"), bucket->buflen);