0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-14 17:58:01 +08:00

Problem: malloc call may fail

Solution: add alloc_assert
This commit is contained in:
Simon Giesecke 2018-05-18 17:31:17 +02:00
parent ad100b0b9f
commit 04ec6aaf28

View File

@ -125,6 +125,7 @@ struct blob_t
{
clear ();
data_ = static_cast<unsigned char *> (malloc (other.size_));
alloc_assert (data_);
size_ = other.size_;
owned_ = true;
memcpy (data_, other.data_, size_);
@ -135,6 +136,7 @@ struct blob_t
{
clear ();
data_ = static_cast<unsigned char *> (malloc (size));
alloc_assert (data_);
size_ = size;
owned_ = true;
memcpy (data_, data, size_);