Fixed potential SEGFAULT.

This commit is contained in:
czach 2014-03-13 11:05:50 +01:00
parent b63c5e5469
commit 79b81f4840

View File

@ -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;
} }
alloc_assert (s); alloc_assert (s);
if (s->mailbox.get_fd () == retired_fd)
if (s->mailbox.get_fd () == -1)
{
delete s;
return NULL; return NULL;
}
return s; return s;
} }