From b54d2dde407921caa7561dde6b45831ba93d0840 Mon Sep 17 00:00:00 2001 From: Hisham Date: Tue, 2 Feb 2016 15:53:02 +0100 Subject: Check for failure in allocations. --- Object.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Object.h') diff --git a/Object.h b/Object.h index 2186ee52..19a667c8 100644 --- a/Object.h +++ b/Object.h @@ -10,6 +10,7 @@ in the source distribution for its full text. */ #include "RichString.h" +#include "XAlloc.h" typedef struct Object_ Object; @@ -27,7 +28,7 @@ typedef void(*Object_Delete)(Object*); #define Class(class_) ((ObjectClass*)(&(class_ ## _class))) -#define AllocThis(class_) (class_*) malloc(sizeof(class_)); Object_setClass(this, Class(class_)); +#define AllocThis(class_) (class_*) xMalloc(sizeof(class_)); Object_setClass(this, Class(class_)); typedef struct ObjectClass_ { const void* extends; -- cgit v1.2.3