mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-07 05:58:45 +01:00
Fix potential segmentation fault
Call the allocation assertion macro before dereferencing the socket pointer.
This commit is contained in:
@@ -121,10 +121,11 @@ 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);
|
||||||
if (s->mailbox.get_fd () == retired_fd)
|
if (s->mailbox.get_fd () == retired_fd)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
alloc_assert (s);
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user