mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-07 12:57:40 +08:00
Merge pull request #1964 from bluca/sock_close_read_after_free
Problem: read-after-free when closing socket
This commit is contained in:
commit
f98b5bb5cf
@ -1290,12 +1290,13 @@ int zmq::socket_base_t::close ()
|
|||||||
// Mark the socket as dead
|
// Mark the socket as dead
|
||||||
tag = 0xdeadbeef;
|
tag = 0xdeadbeef;
|
||||||
|
|
||||||
|
EXIT_MUTEX ();
|
||||||
|
|
||||||
// Transfer the ownership of the socket from this application thread
|
// Transfer the ownership of the socket from this application thread
|
||||||
// to the reaper thread which will take care of the rest of shutdown
|
// to the reaper thread which will take care of the rest of shutdown
|
||||||
// process.
|
// process.
|
||||||
send_reap (this);
|
send_reap (this);
|
||||||
|
|
||||||
EXIT_MUTEX ();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user