[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 130/173: http2: fix memory-leak when denying push s
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 130/173: http2: fix memory-leak when denying push streams |
Date: |
Fri, 24 Feb 2017 14:02:32 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.53.1
in repository gnurl.
commit bde1e2e09b5371cadadc33294592d2bc8188f167
Author: Daniel Stenberg <address@hidden>
AuthorDate: Mon Feb 13 10:35:18 2017 +0100
http2: fix memory-leak when denying push streams
Reported-by: address@hidden
Fixes #1229
---
lib/http2.c | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/lib/http2.c b/lib/http2.c
index dc7bd32e1..af69c7224 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -116,18 +116,11 @@ static int http2_getsock(struct connectdata *conn,
return http2_perform_getsock(conn, sock, numsocks);
}
-static CURLcode http2_disconnect(struct connectdata *conn,
- bool dead_connection)
+/*
+ * http2_stream_free() free HTTP2 stream related data
+ */
+static void http2_stream_free(struct HTTP *http)
{
- struct HTTP *http = conn->data->req.protop;
- struct http_conn *c = &conn->proto.httpc;
- (void)dead_connection;
-
- DEBUGF(infof(conn->data, "HTTP/2 DISCONNECT starts now\n"));
-
- nghttp2_session_del(c->h2);
- Curl_safefree(c->inbuf);
-
if(http) {
Curl_add_buffer_free(http->header_recvbuf);
http->header_recvbuf = NULL; /* clear the pointer */
@@ -139,6 +132,19 @@ static CURLcode http2_disconnect(struct connectdata *conn,
free(http->push_headers);
http->push_headers = NULL;
}
+}
+
+static CURLcode http2_disconnect(struct connectdata *conn,
+ bool dead_connection)
+{
+ struct http_conn *c = &conn->proto.httpc;
+ (void)dead_connection;
+
+ DEBUGF(infof(conn->data, "HTTP/2 DISCONNECT starts now\n"));
+
+ nghttp2_session_del(c->h2);
+ Curl_safefree(c->inbuf);
+ http2_stream_free(conn->data->req.protop);
DEBUGF(infof(conn->data, "HTTP/2 DISCONNECT done\n"));
@@ -419,6 +425,7 @@ static int push_promise(struct Curl_easy *data,
if(rv) {
/* denied, kill off the new handle again */
+ http2_stream_free(newhandle->req.protop);
(void)Curl_close(newhandle);
goto fail;
}
@@ -433,6 +440,7 @@ static int push_promise(struct Curl_easy *data,
rc = Curl_multi_add_perform(data->multi, newhandle, conn);
if(rc) {
infof(data, "failed to add handle to multi\n");
+ http2_stream_free(newhandle->req.protop);
Curl_close(newhandle);
rv = 1;
goto fail;
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 124/173: nss: make FTPS work with --proxytunnel, (continued)
- [GNUnet-SVN] [gnurl] 124/173: nss: make FTPS work with --proxytunnel, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 93/173: INTERNALS.md: language improvements, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 110/173: CHANGES: spell fix, use correct path to script, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 78/173: CURLOPT_CONNECT_TO: Fix compile warnings, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 88/173: vtls: source indentation fix, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 170/173: tests: use consistent environment variables for setting charset, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 153/173: TLS: make SSL_VERIFYSTATUS work again, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 160/173: TODO: HTTP Digest using SHA-256, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 115/173: transfer: only retry nobody-requests for HTTP, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 114/173: telnet: Fix typos, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 130/173: http2: fix memory-leak when denying push streams,
gnunet <=
- [GNUnet-SVN] [gnurl] 158/173: urldata: include curl_sspi.h when Windows SSPI is enabled, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 159/173: TODO: brotli is deployed widely now, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 167/173: TODO: "OPTIONS *", gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 134/173: RELEASE-NOTES: synced with 690935390c29c, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 21/173: digest_sspi: copy terminating NUL as well, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 118/173: RELEASE-NOTES: synced with 102454459dd688c, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 142/173: docs: fix timeout handling in multi-uv example, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 116/173: http2: reset push header counter fixes crash, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 157/173: url: Improve CURLOPT_PROXY_CAPATH error handling, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 121/173: http_proxy: Fix tiny memory leak upon edge case connecting to proxy, gnunet, 2017/02/24