Skip to content

Commit

Permalink
Fix wrong comment and use cheaper destruction macro (php#17359)
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsdos authored Jan 4, 2025
1 parent 7be3649 commit ac8b7b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ext/standard/user_filters.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ac8b7b8

Please sign in to comment.