[pixman-image] [mlk] Free the locally allocated bits.
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 27 Sep 2007 11:46:46 +0000 (12:46 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 27 Sep 2007 12:51:04 +0000 (13:51 +0100)
If we fail to allocate the image, remember to free the bits if we have
created the buffer on behalf of the caller.

pixman/pixman-image.c

index de799b1..d40234d 100644 (file)
@@ -359,8 +359,11 @@ pixman_image_create_bits (pixman_format_code_t  format,
     
     image = allocate_image();
 
-    if (!image)
+    if (!image) {
+       if (free_me)
+           free (free_me);
        return NULL;
+    }
     
     image->type = BITS;
     image->bits.format = format;