From 04ec6aaf28a4f03388396cdeb142b0479b7f212a Mon Sep 17 00:00:00 2001 From: Simon Giesecke Date: Fri, 18 May 2018 17:31:17 +0200 Subject: [PATCH] Problem: malloc call may fail Solution: add alloc_assert --- src/blob.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/blob.hpp b/src/blob.hpp index bdd2ec2b..27a4b04c 100644 --- a/src/blob.hpp +++ b/src/blob.hpp @@ -125,6 +125,7 @@ struct blob_t { clear (); data_ = static_cast (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 (malloc (size)); + alloc_assert (data_); size_ = size; owned_ = true; memcpy (data_, data, size_);