summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2010-04-07 22:54:57 +0200
committerAndrea Canciani <ranma42@gmail.com>2010-04-07 22:58:36 +0200
commit70ca0040fda77b6865c20c94c1b7deaa6e63c481 (patch)
tree0008c993569b100ed97605b41b61674c70497f1f
parentd7f71ac5c209376bacb45199a0eaa3b1937172e9 (diff)
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.
-rw-r--r--src/cairo-boxes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cairo-boxes.c b/src/cairo-boxes.c
index d2b9e7ec..363f8e76 100644
--- a/src/cairo-boxes.c
+++ b/src/cairo-boxes.c
@@ -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;
}