Commit ab5c8c8d authored by Luca Boccassi's avatar Luca Boccassi

Problem: zmq_ctx_term segfaults with too many pending inproc connects

Solution: add a zmq_assert to check if the ephemeral sockets created
to drain the queue of pending inproc connecting sockets was allocated
successfully.
parent fab846a5
......@@ -152,6 +152,8 @@ int zmq::ctx_t::terminate ()
pending_connections_t copy = pending_connections;
for (pending_connections_t::iterator p = copy.begin (); p != copy.end (); ++p) {
zmq::socket_base_t *s = create_socket (ZMQ_PAIR);
// create_socket might fail eg: out of memory/sockets limit reached
zmq_assert (s);
s->bind (p->first.c_str ());
s->close ();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment