mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-01 10:50:28 +08:00
ZMQII-53: Memory leak when using invalid socket type
This commit is contained in:
parent
a1e70f2957
commit
5d16070ffc
@ -134,11 +134,15 @@ zmq::socket_base_t *zmq::dispatcher_t::create_socket (int type_)
|
|||||||
}
|
}
|
||||||
threads_sync.unlock ();
|
threads_sync.unlock ();
|
||||||
|
|
||||||
|
socket_base_t *s = thread->create_socket (type_);
|
||||||
|
if (!s)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
term_sync.lock ();
|
term_sync.lock ();
|
||||||
sockets++;
|
sockets++;
|
||||||
term_sync.unlock ();
|
term_sync.unlock ();
|
||||||
|
|
||||||
return thread->create_socket (type_);
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
void zmq::dispatcher_t::destroy_socket ()
|
void zmq::dispatcher_t::destroy_socket ()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user