2016-10-15 Ville Voutilainen <ville.voutilai...@gmail.com>
Make sure the return value of malloc_allocator::allocate is zero-initialized so that checking it for non-zero works later. * include/ext/malloc_allocator.h (malloc_allocator::allocate): Initialize the return value.
diff --git a/libstdc++-v3/include/ext/malloc_allocator.h b/libstdc++-v3/include/ext/malloc_allocator.h index acb60a2..113c1dc 100644 --- a/libstdc++-v3/include/ext/malloc_allocator.h +++ b/libstdc++-v3/include/ext/malloc_allocator.h @@ -101,7 +101,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if (__n > this->max_size()) std::__throw_bad_alloc(); - pointer __ret; + pointer __ret = 0; #if __cpp_aligned_new #if __cplusplus > 201402L && _GLIBCXX_HAVE_ALIGNED_ALLOC if (alignof(_Tp) > alignof(std::max_align_t))