Skip to content

Commit

Permalink
Merge pull request #1964 from bluca/sock_close_read_after_free
Browse files Browse the repository at this point in the history
Problem: read-after-free when closing socket
  • Loading branch information
somdoron committed May 5, 2016
2 parents e9380b5 + 17132f0 commit f98b5bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/socket_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1290,12 +1290,13 @@ int zmq::socket_base_t::close ()
// Mark the socket as dead
tag = 0xdeadbeef;

EXIT_MUTEX ();

// Transfer the ownership of the socket from this application thread
// to the reaper thread which will take care of the rest of shutdown
// process.
send_reap (this);

EXIT_MUTEX ();
return 0;
}

Expand Down

0 comments on commit f98b5bb

Please sign in to comment.