Commit 16439e42 authored by Constantin Rack's avatar Constantin Rack Committed by GitHub

Merge pull request #2272 from bluca/document_read_after_free

parents d68e2e01 a06f97d7
...@@ -100,6 +100,8 @@ void zmq::radio_t::xwrite_activated (pipe_t *pipe_) ...@@ -100,6 +100,8 @@ void zmq::radio_t::xwrite_activated (pipe_t *pipe_)
void zmq::radio_t::xpipe_terminated (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 (); ) { for (subscriptions_t::iterator it = subscriptions.begin (); it != subscriptions.end (); ) {
if (it->second == pipe_) { if (it->second == pipe_) {
subscriptions.erase (it++); subscriptions.erase (it++);
......
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