src/video/x11/SDL_x11mouse.c
changeset 7071 82f17e656125
parent 6885 700f1b25f77f
child 7191 75360622e65f
--- a/src/video/x11/SDL_x11mouse.c	Wed Apr 17 01:32:06 2013 -0700
+++ b/src/video/x11/SDL_x11mouse.c	Wed Apr 17 01:35:10 2013 -0700
@@ -129,8 +129,14 @@
     unsigned int width_bytes = ((surface->w + 7) & ~7) / 8;
 
     data_bits = SDL_calloc(1, surface->h * width_bytes);
+    if (!data_bits) {
+        SDL_OutOfMemory();
+        return None;
+    }
+
     mask_bits = SDL_calloc(1, surface->h * width_bytes);
-    if (!data_bits || !mask_bits) {
+    if (!mask_bits) {
+        SDL_free(data_bits);
         SDL_OutOfMemory();
         return None;
     }