mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-15 03:21:11 +01:00
Fixed potential SEGFAULT.
This commit is contained in:
parent
b63c5e5469
commit
79b81f4840
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user