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 */