diff options
Diffstat (limited to 'src/core/function/SecureMemoryAllocator.cpp')
-rw-r--r-- | src/core/function/SecureMemoryAllocator.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/function/SecureMemoryAllocator.cpp b/src/core/function/SecureMemoryAllocator.cpp index cb2249c9..c24e13f2 100644 --- a/src/core/function/SecureMemoryAllocator.cpp +++ b/src/core/function/SecureMemoryAllocator.cpp @@ -34,11 +34,13 @@ namespace GpgFrontend { auto SecureMemoryAllocator::Allocate(std::size_t size) -> void* { auto* addr = malloc(size); + if (addr == nullptr) FLOG_F("malloc failed!"); return addr; } auto SecureMemoryAllocator::Reallocate(void* ptr, std::size_t size) -> void* { auto* addr = realloc(ptr, size); + if (addr == nullptr) FLOG_F("realloc failed!"); return addr; } @@ -50,11 +52,13 @@ void SecureMemoryAllocator::Deallocate(void* p) { free(p); } auto SecureMemoryAllocator::Allocate(std::size_t size) -> void* { auto* addr = mi_malloc(size); + if (addr == nullptr) FLOG_F("malloc failed!"); return addr; } auto SecureMemoryAllocator::Reallocate(void* ptr, std::size_t size) -> void* { auto* addr = mi_realloc(ptr, size); + if (addr == nullptr) FLOG_F("realloc memory failed!"); return addr; } |