diff options
author | Benjamin Otte <otte@gnome.org> | 2009-09-20 19:30:57 +0200 |
---|---|---|
committer | Søren Sandmann Pedersen <sandmann@redhat.com> | 2009-11-20 20:23:56 +0100 |
commit | 1e98a9c75fae7c9bb0b30974be3c684b6cdcd6b1 (patch) | |
tree | 531c5e763d2be7e9f4d0ad567c33d63e11e8fd80 | |
parent | b045fe8b497f9c5e55b98e4595f8a152d84679dd (diff) |
Reorganize allocation
Eases future changes
-rw-r--r-- | pixman/pixman-bits-image.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c index 5a5a6905..3257af07 100644 --- a/pixman/pixman-bits-image.c +++ b/pixman/pixman-bits-image.c @@ -1043,21 +1043,19 @@ pixman_image_create_bits (pixman_format_code_t format, return_val_if_fail (bits == NULL || (rowstride_bytes % sizeof (uint32_t)) == 0, NULL); + image = _pixman_image_allocate (); + + if (!image) + return NULL; + if (!bits && width && height) { free_me = bits = create_bits (format, width, height, &rowstride_bytes); if (!bits) + { + free (image); return NULL; - } - - image = _pixman_image_allocate (); - - if (!image) - { - if (free_me) - free (free_me); - - return NULL; + } } image->type = BITS; |