0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-29 16:45:51 +08:00

ZMQII-53: Memory leak when using invalid socket type

This commit is contained in:
Martin Sustrik 2010-02-02 08:46:35 +01:00
parent a1e70f2957
commit 5d16070ffc

View File

@ -134,11 +134,15 @@ zmq::socket_base_t *zmq::dispatcher_t::create_socket (int type_)
}
threads_sync.unlock ();
socket_base_t *s = thread->create_socket (type_);
if (!s)
return NULL;
term_sync.lock ();
sockets++;
term_sync.unlock ();
return thread->create_socket (type_);
return s;
}
void zmq::dispatcher_t::destroy_socket ()