aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/http.c1
-rw-r--r--lib/http2.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/http.c b/lib/http.c
index b2ecc9c0a..6d11c288b 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -163,7 +163,6 @@ CURLcode Curl_http_setup_conn(struct connectdata *conn)
conn->data->req.protop = http;
- http->header_recvbuf = Curl_add_buffer_init();
http->nread_header_recvbuf = 0;
http->bodystarted = FALSE;
http->status_code = -1;
diff --git a/lib/http2.c b/lib/http2.c
index 7070df511..b492e286a 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -1168,6 +1168,9 @@ CURLcode Curl_http2_setup(struct connectdata *conn)
stream->stream_id = -1;
+ if(!stream->header_recvbuf)
+ stream->header_recvbuf = Curl_add_buffer_init();
+
if((conn->handler == &Curl_handler_http2_ssl) ||
(conn->handler == &Curl_handler_http2))
return CURLE_OK; /* already done */