X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_request_object.c;h=74dbe4f18d8a5be8a6e2951894d1ac1a6f71081f;hb=5977bd2facb8a842b3ca3ee677b8014407e75941;hp=ad6e43202b1b421c88773427ad1dd2e06d89675d;hpb=5aa958980652d72433ba8e9e500b8dfd123d56a1;p=m6w6%2Fext-http diff --git a/http_request_object.c b/http_request_object.c index ad6e432..74dbe4f 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -337,8 +337,10 @@ zend_object_value _http_request_object_clone_obj(zval *this_ptr TSRMLS_DC) getObject(http_request_object, old_obj); old_zo = zend_objects_get_address(this_ptr TSRMLS_CC); - new_ov = http_request_object_new_ex(old_zo->ce, curl_easy_duphandle(old_obj->request->ch), &new_obj); - http_curl_init_ex(new_obj->request->ch, new_obj->request, new_obj->request->_error); + new_ov = http_request_object_new_ex(old_zo->ce, NULL, &new_obj); + if (old_obj->request->ch) { + new_obj->request->ch = http_curl_init_ex(curl_easy_duphandle(old_obj->request->ch), new_obj->request, new_obj->request->_error); + } zend_objects_clone_members(&new_obj->zo, new_ov, old_zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); phpstr_append(&new_obj->history, old_obj->history.data, old_obj->history.used); @@ -627,7 +629,7 @@ STATUS _http_request_object_responsehandler(http_request_object *obj, zval *this _http_request_object_set_options_subr(INTERNAL_FUNCTION_PARAM_PASSTHRU, (key), sizeof(key), (ow)) static inline void _http_request_object_set_options_subr(INTERNAL_FUNCTION_PARAMETERS, char *key, size_t len, int overwrite) { - zval *old_opts, *new_opts, *opts, **entry; + zval *old_opts, *new_opts, *opts = NULL, **entry; getObject(http_request_object, obj); if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a/!", &opts)) {