From 286345a2efcd0ab7f8d4aebf8a048253c2ede9e8 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 25 Dec 2013 00:29:36 +0900 Subject: [PATCH] examples/libevent-client.c: Fix memory leak, use nghttp2_session_fail_session --- examples/libevent-client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/libevent-client.c b/examples/libevent-client.c index 56896150..7d31c081 100644 --- a/examples/libevent-client.c +++ b/examples/libevent-client.c @@ -146,6 +146,7 @@ static void delete_http2_session_data(http2_session_data *session_data) delete_http2_stream_data(session_data->stream_data); session_data->stream_data = NULL; } + free(session_data); } /* Print HTTP headers to |f|. Please note that this function does not @@ -249,8 +250,7 @@ static int on_stream_close_callback(nghttp2_session *session, if(session_data->stream_data->stream_id == stream_id) { fprintf(stderr, "Stream %d closed with error_code=%d\n", stream_id, error_code); - rv = nghttp2_submit_goaway(session, NGHTTP2_FLAG_NONE, NGHTTP2_NO_ERROR, - NULL, 0); + rv = nghttp2_session_fail_session(session, NGHTTP2_NO_ERROR); if(rv != 0) { return NGHTTP2_ERR_CALLBACK_FAILURE; }