From 864c18f797203c06e66e739166b246cfb3d47ce9 Mon Sep 17 00:00:00 2001 From: Paul Colomiets Date: Tue, 17 May 2011 10:09:04 +0200 Subject: zmq_msg_init_data returns ERRNO instead aborting Signed-off-by: Paul Colomiets --- src/msg.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/msg.cpp b/src/msg.cpp index f88a902..84ca3e2 100644 --- a/src/msg.cpp +++ b/src/msg.cpp @@ -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_; -- cgit v1.2.3