diff --git a/src/socket_base.cpp b/src/socket_base.cpp index d0e712f8..630e7981 100644 --- a/src/socket_base.cpp +++ b/src/socket_base.cpp @@ -121,13 +121,10 @@ zmq::socket_base_t *zmq::socket_base_t::create (int type_, class ctx_t *parent_, errno = EINVAL; return NULL; } - alloc_assert (s); - if (s->mailbox.get_fd () == -1) - { - delete s; + alloc_assert (s); + if (s->mailbox.get_fd () == retired_fd) return NULL; - } return s; }