From 2ef516e66a8a72b7ddf119867617c13ef147a05e Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 24 Jan 2024 17:37:01 -0500 Subject: [PATCH] check against nullptr --- include/blt/std/allocator.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/blt/std/allocator.h b/include/blt/std/allocator.h index 3b5bfa5..40181a0 100644 --- a/include/blt/std/allocator.h +++ b/include/blt/std/allocator.h @@ -210,6 +210,8 @@ namespace blt void deallocate(pointer p, size_t n) noexcept { + if (p == nullptr) + return; // for (size_t i = 0; i < n; i++) // p[i].~T(); for (auto*& blk : blocks)