0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-31 01:43:02 +08:00

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.
This commit is contained in:
Luca Boccassi 2016-09-24 18:57:59 +01:00
parent fab846a5e5
commit ab5c8c8dea

View File

@ -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 ();
}