Skip to content

Commit

Permalink
http2: free all header memory after the push callback
Browse files Browse the repository at this point in the history
  • Loading branch information
bagder committed Jun 24, 2015
1 parent e9f0dd4 commit a3a55d8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/http2.c
Expand Up @@ -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) {
Expand All @@ -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; i<stream->push_headers_used; i++)
free(stream->push_headers[i]);
free(stream->push_headers);
stream->push_headers = NULL;

Expand Down

0 comments on commit a3a55d8

Please sign in to comment.