1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

http2: Fixed OOM handling in upgrade request

This caused the torture tests on test 1800 to fail.
This commit is contained in:
Dan Fandrich 2017-11-01 14:36:15 +01:00
parent 591f5d18cf
commit 544bfdebea

View File

@ -1183,14 +1183,17 @@ CURLcode Curl_http2_request_upgrade(Curl_send_buffer *req,
httpc->local_settings_num);
if(!binlen) {
failf(conn->data, "nghttp2 unexpectedly failed on pack_settings_payload");
Curl_add_buffer_free(req);
return CURLE_FAILED_INIT;
}
conn->proto.httpc.binlen = binlen;
result = Curl_base64url_encode(conn->data, (const char *)binsettings, binlen,
&base64, &blen);
if(result)
if(result) {
Curl_add_buffer_free(req);
return result;
}
result = Curl_add_bufferf(req,
"Connection: Upgrade, HTTP2-Settings\r\n"