aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2015-07-06 22:16:27 +0900
committerDaniel Stenberg <daniel@haxx.se>2015-07-07 12:33:41 +0200
commit845b011614b8ad97dd67e0d9307e972b010f68f4 (patch)
tree6af00ca92cabae70637da7d2c11fb374e328e70e /lib
parentce1bf87a04e3d5e42c2709ed106d62e80669c63b (diff)
http2: Fix memory leak in push header array
Diffstat (limited to 'lib')
-rw-r--r--lib/http.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/http.c b/lib/http.c
index f64a56546..b9e804771 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -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;
}
@@ -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;
}