Commit 5a47fc4f authored by Pieter Hintjens's avatar Pieter Hintjens

Merge pull request #871 from apyrgio/develop

Fix potential segfault/memleak
parents 0ac223c7 50d34e56
...@@ -121,10 +121,13 @@ zmq::socket_base_t *zmq::socket_base_t::create (int type_, class ctx_t *parent_, ...@@ -121,10 +121,13 @@ zmq::socket_base_t *zmq::socket_base_t::create (int type_, class ctx_t *parent_,
errno = EINVAL; errno = EINVAL;
return NULL; return NULL;
} }
if (s->mailbox.get_fd () == retired_fd)
return NULL;
alloc_assert (s); alloc_assert (s);
if (s->mailbox.get_fd () == retired_fd) {
delete s;
return NULL;
}
return s; return s;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment