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. */