xzalloc is guaranteed to return a non-NULL value.

Signed-off-by: Seedo Eldho Paul <[email protected]>
---
 tests/internal-screenshot-test.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/tests/internal-screenshot-test.c b/tests/internal-screenshot-test.c
index e72a695..a74ae7a 100644
--- a/tests/internal-screenshot-test.c
+++ b/tests/internal-screenshot-test.c
@@ -93,11 +93,6 @@ load_surface_from_png(const char *fname)
 
        /* Disguise the cairo surface in a weston test surface */
        reference = xzalloc(sizeof *reference);
-       if (reference == NULL) {
-               perror("xzalloc reference");
-               cairo_surface_destroy(reference_cairo_surface);
-               return NULL;
-       }
        reference->width = 
cairo_image_surface_get_width(reference_cairo_surface);
        reference->height = 
cairo_image_surface_get_height(reference_cairo_surface);
        stride = cairo_image_surface_get_stride(reference_cairo_surface);
@@ -115,12 +110,6 @@ load_surface_from_png(const char *fname)
        /* Allocate new buffer for our weston reference, and copy the data from
           the cairo surface so we can destroy it */
        reference->data = xzalloc(source_data_size);
-       if (reference->data == NULL) {
-               perror("xzalloc reference data");
-               cairo_surface_destroy(reference_cairo_surface);
-               free(reference);
-               return NULL;
-       }
        memcpy(reference->data,
               cairo_image_surface_get_data(reference_cairo_surface),
               source_data_size);
@@ -144,8 +133,6 @@ create_screenshot_surface(struct client *client)
 {
        struct surface* screenshot;
        screenshot = xzalloc(sizeof *screenshot);
-       if (screenshot == NULL)
-               return NULL;
        screenshot->wl_buffer = create_shm_buffer(client,
                                                  client->output->width,
                                                  client->output->height,
-- 
1.9.1

_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to