From 9ca63de9e8b2d197b1f27cd98304add3ce512d4b Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 1 May 2014 10:46:08 +0900 Subject: [PATCH] examples: Zero clear callbacks --- examples/libevent-client.c | 2 ++ examples/libevent-server.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/examples/libevent-client.c b/examples/libevent-client.c index fd4aad5b..251d7ecf 100644 --- a/examples/libevent-client.c +++ b/examples/libevent-client.c @@ -354,6 +354,8 @@ static void initialize_nghttp2_session(http2_session_data *session_data) { nghttp2_session_callbacks callbacks; + memset(&callbacks, 0, sizeof(callbacks)); + callbacks.send_callback = send_callback; callbacks.before_frame_send_callback = before_frame_send_callback; callbacks.on_frame_recv_callback = on_frame_recv_callback; diff --git a/examples/libevent-server.c b/examples/libevent-server.c index 1efa7e02..239292db 100644 --- a/examples/libevent-server.c +++ b/examples/libevent-server.c @@ -551,6 +551,8 @@ static void initialize_nghttp2_session(http2_session_data *session_data) { nghttp2_session_callbacks callbacks; + memset(&callbacks, 0, sizeof(callbacks)); + callbacks.send_callback = send_callback; callbacks.on_frame_recv_callback = on_frame_recv_callback; callbacks.on_stream_close_callback = on_stream_close_callback;