From a3a55d80ecc7cb44239b774a6a1d37adc6bf2fc8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 2 Jun 2015 11:01:30 +0200 Subject: [PATCH] http2: free all header memory after the push callback --- lib/http2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/http2.c b/lib/http2.c index 674a39c09a..5587b3d2b6 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -296,6 +296,7 @@ static int push_promise(struct SessionHandle *data, struct curl_pushheaders heads; CURLMcode rc; struct http_conn *httpc; + size_t i; /* clone the parent */ CURL *newhandle = duphandle(data); if(!newhandle) { @@ -315,7 +316,9 @@ static int push_promise(struct SessionHandle *data, stream->push_headers_used, &heads, data->multi->push_userp); - /* free the headers array again */ + /* free the headers again */ + for(i=0; ipush_headers_used; i++) + free(stream->push_headers[i]); free(stream->push_headers); stream->push_headers = NULL;