hyper_body_set_data_func(body, uploadpostfields);
else {
result = Curl_get_upload_buffer(data);
- if(result)
+ if(result) {
+ hyper_body_free(body);
return result;
+ }
/* init the "upload from here" pointer */
data->req.upload_fromhere = data->state.ulbuf;
hyper_body_set_data_func(body, uploadstreamed);
}
if(HYPERE_OK != hyper_request_set_body(hyperreq, body)) {
/* fail */
- hyper_body_free(body);
result = CURLE_OUT_OF_MEMORY;
}
}
result = CURLE_OUT_OF_MEMORY;
goto error;
}
+ sendtask = NULL; /* ownership passed on */
hyper_clientconn_free(client);
client = NULL;
}
options = hyper_clientconn_options_new();
- hyper_clientconn_options_set_preserve_header_case(options, 1);
- hyper_clientconn_options_set_preserve_header_order(options, 1);
-
if(!options) {
failf(data, "Couldn't create hyper client options");
result = CURLE_OUT_OF_MEMORY;
goto error;
}
+ hyper_clientconn_options_set_preserve_header_case(options, 1);
+ hyper_clientconn_options_set_preserve_header_order(options, 1);
hyper_clientconn_options_exec(options, h->exec);
client = hyper_task_value(task);
hyper_task_free(task);
+
req = hyper_request_new();
if(!req) {
failf(data, "Couldn't hyper_request_new");
result = CURLE_OUT_OF_MEMORY;
goto error;
}
+ req = NULL;
if(HYPERE_OK != hyper_executor_push(h->exec, sendtask)) {
failf(data, "Couldn't hyper_executor_push the send");
result = CURLE_OUT_OF_MEMORY;
goto error;
}
+ sendtask = NULL; /* ownership passed on */
+
+ hyper_clientconn_free(client);
+ client = NULL;
error:
free(host);
hyper_task_free(handshake);
if(client)
hyper_clientconn_free(client);
+ if(req)
+ hyper_request_free(req);
+
return result;
}