Actually check for memory allocation failure

Clang static analyzer signals "Dereference of null pointer" in case
the malloc returns NULL, as the code is checking the wrong pointer.
This commit is contained in:
Andrea Canciani 2010-04-07 22:54:57 +02:00
parent d7f71ac5c2
commit 70ca0040fd

View file

@ -128,7 +128,7 @@ _cairo_boxes_add_internal (cairo_boxes_t *boxes,
sizeof (cairo_box_t),
sizeof (struct _cairo_boxes_chunk));
if (unlikely (chunk == NULL)) {
if (unlikely (chunk->next == NULL)) {
boxes->status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
return;
}