diff --git a/include/utils/memory.hpp b/include/utils/memory.hpp index c5af2765..32281264 100644 --- a/include/utils/memory.hpp +++ b/include/utils/memory.hpp @@ -1,5 +1,7 @@ #pragma once +#include + #include "common.hpp" POLYBAR_NS @@ -10,7 +12,9 @@ namespace memory_util { */ template inline auto make_malloc_ptr(size_t size = sizeof(T), Deleter deleter = free) { - return shared_ptr(static_cast(malloc(size)), deleter); + shared_ptr ptr{static_cast(malloc(size)), deleter}; + memset(ptr.get(), 0, size); + return ptr; } /**