diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2010-02-02 08:46:35 +0100 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2010-02-02 08:46:35 +0100 |
commit | 5d16070ffcd426e81ea27520f6847d68e5e5af80 (patch) | |
tree | b3a160c5f5673c8bcf6484e286f35725abef32b6 /src | |
parent | a1e70f29575994798df1d57314193782f6d9cdcb (diff) |
ZMQII-53: Memory leak when using invalid socket type
Diffstat (limited to 'src')
-rw-r--r-- | src/dispatcher.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dispatcher.cpp b/src/dispatcher.cpp index 9e713c2..b830654 100644 --- a/src/dispatcher.cpp +++ b/src/dispatcher.cpp @@ -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 () |