summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Colomiets <pc@gafol.net>2011-05-17 10:09:04 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-05-17 10:09:04 +0200
commit864c18f797203c06e66e739166b246cfb3d47ce9 (patch)
treea9b010653272af2df27d1742c776de8b6f03dfa0 /src
parentd8d5a627b1835d20270125e27a157c9a7460f0e7 (diff)
zmq_msg_init_data returns ERRNO instead aborting
Signed-off-by: Paul Colomiets <pc@gafol.net>
Diffstat (limited to 'src')
-rw-r--r--src/msg.cpp5
1 files changed, 4 insertions, 1 deletions
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_;