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:
parent
ad100b0b9f
commit
04ec6aaf28
@ -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_);
|
||||
|
Loading…
x
Reference in New Issue
Block a user