From 6bc46e6ad1ff4fb17b7d0b0117ba113f310849e5 Mon Sep 17 00:00:00 2001 From: FutureRave Date: Sat, 26 Nov 2022 15:22:36 +0000 Subject: [PATCH] refactor(memory): remove nullptr check before std::free --- src/common/utils/memory.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/common/utils/memory.cpp b/src/common/utils/memory.cpp index 99a03916..5fdbd804 100644 --- a/src/common/utils/memory.cpp +++ b/src/common/utils/memory.cpp @@ -72,7 +72,7 @@ namespace utils void* memory::allocate(const size_t length) { - return calloc(length, 1); + return std::calloc(length, 1); } char* memory::duplicate_string(const std::string& string) @@ -84,10 +84,7 @@ namespace utils void memory::free(void* data) { - if (data) - { - ::free(data); - } + std::free(data); } void memory::free(const void* data)