nghttp: Check req is null, found by coverity

This commit is contained in:
Tatsuhiro Tsujikawa 2015-09-16 22:18:09 +09:00
parent ee4732a676
commit c6785abd1f
1 changed files with 5 additions and 0 deletions

View File

@ -1868,8 +1868,13 @@ int on_frame_not_send_callback(nghttp2_session *session,
frame->headers.cat != NGHTTP2_HCAT_REQUEST) {
return 0;
}
auto req = static_cast<Request *>(
nghttp2_session_get_stream_user_data(session, frame->hd.stream_id));
if (!req) {
return 0;
}
std::cerr << "[ERROR] request " << req->uri
<< " failed: " << nghttp2_strerror(lib_error_code) << std::endl;