From acbb2f7b25b547893ff70f99c82f3527e24990d5 Mon Sep 17 00:00:00 2001 From: Meep-Eep Date: Sat, 14 Nov 2009 18:44:33 +0000 Subject: [PATCH] Add missing error handling. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3301 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/libs/graphics/drawable.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sc2/src/libs/graphics/drawable.c b/sc2/src/libs/graphics/drawable.c index 13a845ecd..2a14d991e 100644 --- a/sc2/src/libs/graphics/drawable.c +++ b/sc2/src/libs/graphics/drawable.c @@ -91,6 +91,11 @@ AllocDrawable (COUNT n) { int i; Drawable->Frame = (FRAME)HMalloc (sizeof (FRAME_DESC) * n); + if (Drawable->Frame == NULL) + { + HFree (Drawable); + return NULL; + } /* Zero out the newly allocated frames, since HMalloc doesn't have * MEM_ZEROINIT. */