mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-13 10:52:56 +01:00
Handshake events null pointer fix
The mechanism is instanciated during the handshake itself, when and error happen before this, the error method shall work anyway. An error handling with a NULL mechanism means the handshake fail, so the handshake failure event is also raised in this case.
This commit is contained in:
parent
ffb31dcadd
commit
7e36db07b1
@ -978,7 +978,7 @@ void zmq::stream_engine_t::error (error_reason_t reason)
|
||||
}
|
||||
zmq_assert (session);
|
||||
#ifdef ZMQ_BUILD_DRAFT_API
|
||||
if(mechanism->status() == mechanism_t::handshaking)
|
||||
if(mechanism == NULL || mechanism->status() == mechanism_t::handshaking)
|
||||
socket->event_handshake_failed(endpoint, (int) s);
|
||||
#endif
|
||||
socket->event_disconnected (endpoint, (int) s);
|
||||
|
Loading…
Reference in New Issue
Block a user