mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-04 19:13:35 +01:00
Fix a bug in pipe_t::flush().
Static analysis says: src\pipe.cpp(193): error V547: Expression is always false. Probably the '||' operator should be used here. If flush() is called on a pipe whose state was "terminated" or "double_terminated", the programmer's intent was to return immediately. But in fact the two conditions can never be true simultaneously, so the early return never happens, and we may try to flush a terminated pipe anyway.
This commit is contained in:
parent
0886b7a26b
commit
6347d392fd
@ -190,7 +190,7 @@ void zmq::pipe_t::rollback ()
|
||||
void zmq::pipe_t::flush ()
|
||||
{
|
||||
// If terminate() was already called do nothing.
|
||||
if (state == terminated && state == double_terminated)
|
||||
if (state == terminated || state == double_terminated)
|
||||
return;
|
||||
|
||||
// The peer does not exist anymore at this point.
|
||||
|
Loading…
x
Reference in New Issue
Block a user