You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've copied the code form https://curl.haxx.se/libcurl/c/http2-serverpush.html. And just return CURL_PUSH_DENY in server_push_callback() to test if can reject server push steam. All is fine except that valgrind complains about memory leakage.
I expected the following
No memory leakage even rejecting server push stream.
curl/libcurl version
libcurl: curl-7_52_1
nghttp2: v1.18.1
operating system
Fedora 19, x86_64
I think better to destroy the following 2 pointers when failure or rejecting steam.
diff --git a/lib/http2.c b/lib/http2.c
index 4cc17ba..fa7bdb6 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -418,6 +418,9 @@ static int push_promise(struct Curl_easy *data,
if(rv) {
/* denied, kill off the new handle again */
+ Curl_add_buffer_free(
+ ((struct HTTP *)(newhandle->req.protop))->header_recvbuf);
+ free(newhandle->req.protop);
(void)Curl_close(newhandle);
goto fail;
}
@@ -432,6 +435,9 @@ 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");
+ Curl_add_buffer_free(
+ ((struct HTTP *)(newhandle->req.protop))->header_recvbuf);
+ free(newhandle->req.protop);
Curl_close(newhandle);
rv = 1;
goto fail;
The text was updated successfully, but these errors were encountered:
I did this
I've copied the code form https://curl.haxx.se/libcurl/c/http2-serverpush.html. And just return CURL_PUSH_DENY in server_push_callback() to test if can reject server push steam. All is fine except that valgrind complains about memory leakage.
I expected the following
No memory leakage even rejecting server push stream.
curl/libcurl version
libcurl: curl-7_52_1
nghttp2: v1.18.1
operating system
Fedora 19, x86_64
I think better to destroy the following 2 pointers when failure or rejecting steam.
The text was updated successfully, but these errors were encountered: