summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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_;