From 1a300aa22028de87a0ba7cf7dbb8778c590790a6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 3 Nov 2020 06:51:42 +0100 Subject: [PATCH] - fixed GC crash with new statusbar code. It looks GZDoom never run in the case where using Create<> to create an object this left a pointer uninitialized. To be safe, use Calloc instead of Malloc to get the memory for the new object so that everything is nulled. --- source/common/objects/dobject.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common/objects/dobject.h b/source/common/objects/dobject.h index f9c0c0b0a..a866a4ca5 100644 --- a/source/common/objects/dobject.h +++ b/source/common/objects/dobject.h @@ -266,7 +266,7 @@ private: void *operator new(size_t len, nonew&) { - return M_Malloc(len); + return M_Calloc(len, 1); } public: