0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-28 16:15:23 +08:00

Merge pull request #2272 from bluca/document_read_after_free

This commit is contained in:
Constantin Rack 2016-12-26 15:24:44 +01:00 committed by GitHub
commit 16439e42d2

View File

@ -100,6 +100,8 @@ void zmq::radio_t::xwrite_activated (pipe_t *pipe_)
void zmq::radio_t::xpipe_terminated (pipe_t *pipe_)
{
// NOTE: erase invalidates an iterator, and that's why it's not incrementing in post-loop
// read-after-free caught by Valgrind, see https://github.com/zeromq/libzmq/pull/1771
for (subscriptions_t::iterator it = subscriptions.begin (); it != subscriptions.end (); ) {
if (it->second == pipe_) {
subscriptions.erase (it++);