Merge pull request #922 from horus42/master

Fixed potential SEGFAULT in socket_base.cpp
This commit is contained in:
Pieter Hintjens 2014-03-13 12:46:09 +01:00
commit a5e397a55e

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;
} }