From 4cad81638e964942657471dfa0ba167da721dfee Mon Sep 17 00:00:00 2001 From: James Buckland Date: Fri, 13 Jul 2018 10:15:08 -0400 Subject: [PATCH] Throw std::bad_alloc() in HeapRawStatDataAllocator::alloc() Signed-off-by: James Buckland --- source/common/stats/stats_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common/stats/stats_impl.cc b/source/common/stats/stats_impl.cc index 2b707bed0587..e0a370ae1672 100644 --- a/source/common/stats/stats_impl.cc +++ b/source/common/stats/stats_impl.cc @@ -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(::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);