From 002177e33f47533b4d07655ad8adca39765ffea7 Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Fri, 5 Feb 2016 03:03:34 +0100 Subject: [PATCH] - Fixed alloc/dealloc mismatch in PClass code. The function 'PClassActor::InitializeNativeDefault' is the only one which didn't allocate the 'Defaults' member variable with M_Malloc. Reported by the Address Sanitizer. --- src/info.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info.cpp b/src/info.cpp index 07ae29eb0..2adfd14cc 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -321,7 +321,7 @@ void PClassActor::InitializeNativeDefaults() { Symbols.SetParentTable(&ParentClass->Symbols); assert(Defaults == NULL); - Defaults = new BYTE[Size]; + Defaults = (BYTE *)M_Malloc(Size); if (ParentClass->Defaults != NULL) { memcpy(Defaults, ParentClass->Defaults, ParentClass->Size);