Commit 864c18f7 authored by Paul Colomiets's avatar Paul Colomiets Committed by Martin Sustrik

zmq_msg_init_data returns ERRNO instead aborting

Signed-off-by: 's avatarPaul Colomiets <pc@gafol.net>
parent d8d5a627
......@@ -44,7 +44,9 @@ it shall return `-1` and set 'errno' to one of the values defined below.
ERRORS
------
No errors are defined.
*ENOMEM*::
Insufficient storage space is available.
EXAMPLE
......
......@@ -74,7 +74,10 @@ int zmq::msg_t::init_data (void *data_, size_t size_, msg_free_fn *ffn_,
u.lmsg.type = type_lmsg;
u.lmsg.flags = 0;
u.lmsg.content = (content_t*) malloc (sizeof (content_t));
alloc_assert (u.lmsg.content);
if (!u.lmsg.content) {
errno = ENOMEM;
return -1;
}
u.lmsg.content->data = data_;
u.lmsg.content->size = size_;
......
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