From: Michael Wallner Date: Thu, 22 Dec 2005 16:20:27 +0000 (+0000) Subject: - create another copy of the header zval X-Git-Tag: RELEASE_0_21_0~45 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=0c20f7c9ead5ddda3f386361932438fe96283da0;hp=604c0e53f847efab109d18068894a2ca7fc55df5 - create another copy of the header zval --- diff --git a/http_request_api.c b/http_request_api.c index 8514480..260b1f4 100644 --- a/http_request_api.c +++ b/http_request_api.c @@ -471,12 +471,16 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti zval **header_val; if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_P(zoption), (void **) &header_val, &pos)) { char header[1024] = {0}; + zval val; - SEPARATE_ZVAL(header_val); - convert_to_string(*header_val); + val = **header_val; + zval_copy_ctor(&val); + INIT_PZVAL(&val); + convert_to_string(&val); - snprintf(header, 1023, "%s: %s", header_key, Z_STRVAL_PP(header_val)); + snprintf(header, 1023, "%s: %s", header_key, Z_STRVAL(val)); request->_cache.headers = curl_slist_append(request->_cache.headers, header); + zval_dtor(&val); } /* reset */