Commit e6ef16d0 authored by Alex Pyrgiotis's avatar Alex Pyrgiotis

Fix potential segmentation fault

Call the allocation assertion macro before dereferencing the socket
pointer.
parent 0ac223c7
......@@ -121,10 +121,11 @@ 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 () == retired_fd)
return NULL;
alloc_assert (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