From: Sara Golemon Date: Mon, 16 Jun 2003 18:19:14 +0000 (+0000) Subject: optionvalue is being copied via zval_copy_ctor, there's no need to addref the original X-Git-Tag: RELEASE_1_0_2~181 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2f4e91bf8a25ca7b47e7688281d432500eeae97f;p=php optionvalue is being copied via zval_copy_ctor, there's no need to addref the original --- diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 8a2c01cc35..aa729cc53f 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -650,7 +650,6 @@ static int parse_context_options(php_stream_context *context, zval *options) while (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(wval), (void**)&oval, &opos)) { if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(Z_ARRVAL_PP(wval), &okey, &okey_len, NULL, 0, &opos)) { - ZVAL_ADDREF(*oval); php_stream_context_set_option(context, wkey, okey, *oval); } zend_hash_move_forward_ex(Z_ARRVAL_PP(wval), &opos); diff --git a/main/streams/streams.c b/main/streams/streams.c index f35b401b0d..15483d9d64 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -1676,7 +1676,6 @@ PHPAPI int php_stream_context_set_option(php_stream_context *context, return FAILURE; } - ZVAL_ADDREF(optionvalue); wrapperhash = &category; } return zend_hash_update(Z_ARRVAL_PP(wrapperhash), (char*)optionname, strlen(optionname)+1, (void**)&copied_val, sizeof(zval *), NULL);