mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-06 21:56:25 +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;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
alloc_assert (s);
|
||||
if (s->mailbox.get_fd () == retired_fd)
|
||||
return NULL;
|
||||
|
||||
alloc_assert (s);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user