Commit 04ec6aaf authored by Simon Giesecke's avatar Simon Giesecke

Problem: malloc call may fail

Solution: add alloc_assert
parent ad100b0b
...@@ -125,6 +125,7 @@ struct blob_t ...@@ -125,6 +125,7 @@ struct blob_t
{ {
clear (); clear ();
data_ = static_cast<unsigned char *> (malloc (other.size_)); data_ = static_cast<unsigned char *> (malloc (other.size_));
alloc_assert (data_);
size_ = other.size_; size_ = other.size_;
owned_ = true; owned_ = true;
memcpy (data_, other.data_, size_); memcpy (data_, other.data_, size_);
...@@ -135,6 +136,7 @@ struct blob_t ...@@ -135,6 +136,7 @@ struct blob_t
{ {
clear (); clear ();
data_ = static_cast<unsigned char *> (malloc (size)); data_ = static_cast<unsigned char *> (malloc (size));
alloc_assert (data_);
size_ = size; size_ = size;
owned_ = true; owned_ = true;
memcpy (data_, data, size_); memcpy (data_, data, size_);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment