Skip to content

Commit

Permalink
Throw std::bad_alloc() in HeapRawStatDataAllocator::alloc()
Browse files Browse the repository at this point in the history
Signed-off-by: James Buckland <jbuckland@google.com>
  • Loading branch information
ambuc committed Jul 13, 2018
1 parent 19e0311 commit 4cad816
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/common/stats/stats_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ RawStatData* HeapRawStatDataAllocator::alloc(const std::string& name) {
uint64_t num_bytes_to_allocate = RawStatData::structSize(name.size());
RawStatData* data = static_cast<RawStatData*>(::calloc(num_bytes_to_allocate, 1));
if (data == nullptr) {
throw EnvoyException("HeapRawStatDataAllocator: unable to allocate a new stat");
throw std::bad_alloc();
}
data->checkAndInit(name, num_bytes_to_allocate);

Expand Down

0 comments on commit 4cad816

Please sign in to comment.