Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
http2: Fix memory leak in push header array
  • Loading branch information
tatsuhiro-t authored and bagder committed Jul 7, 2015
1 parent ce1bf87 commit 845b011
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/http.c
Expand Up @@ -176,6 +176,9 @@ static CURLcode http_disconnect(struct connectdata *conn, bool dead_connection)
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;
}
Expand Down Expand Up @@ -1494,6 +1497,9 @@ CURLcode Curl_http_done(struct connectdata *conn,
DEBUGF(infof(data, "free header_recvbuf!!\n"));
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;
}
Expand Down

0 comments on commit 845b011

Please sign in to comment.