]> granicus.if.org Git - curl/commitdiff
http2: free all header memory after the push callback
authorDaniel Stenberg <daniel@haxx.se>
Tue, 2 Jun 2015 09:01:30 +0000 (11:01 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 24 Jun 2015 21:44:42 +0000 (23:44 +0200)
lib/http2.c

index 674a39c09aeec708e1b67ab2e041fb333c29dc2a..5587b3d2b6a71331d1f6a8ec07c6cbd37e12d3b8 100644 (file)
@@ -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; i<stream->push_headers_used; i++)
+      free(stream->push_headers[i]);
     free(stream->push_headers);
     stream->push_headers = NULL;