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.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Object.c') diff --git a/Object.c b/Object.c index 53b9976b..120d28c1 100644 --- a/Object.c +++ b/Object.c @@ -9,6 +9,7 @@ in the source distribution for its full text. /*{ #include "RichString.h" +#include "XAlloc.h" typedef struct Object_ Object; @@ -26,7 +27,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