aboutsummaryrefslogtreecommitdiff
path: root/lib/http2.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/http2.c')
-rw-r--r--lib/http2.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 1a2c48649..eec0c9fca 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -80,6 +80,7 @@ static int http2_getsock(struct connectdata *conn,
static CURLcode http2_disconnect(struct connectdata *conn,
bool dead_connection)
{
+ struct HTTP *http = conn->data->req.protop;
struct http_conn *c = &conn->proto.httpc;
(void)dead_connection;
@@ -89,6 +90,16 @@ static CURLcode http2_disconnect(struct connectdata *conn,
Curl_safefree(c->inbuf);
Curl_hash_destroy(&c->streamsh);
+ if(http) {
+ Curl_add_buffer_free(http->header_recvbuf);
+ http->header_recvbuf = NULL; /* clear the pointer */
+ for(; http->push_headers_used > 0; --http->push_headers_used) {
+ free(http->push_headers[http->push_headers_used - 1]);
+ }
+ free(http->push_headers);
+ http->push_headers = NULL;
+ }
+
DEBUGF(infof(conn->data, "HTTP/2 DISCONNECT done\n"));
return CURLE_OK;