mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-06-16 06:18:29 +02:00
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:
parent
d7f71ac5c2
commit
70ca0040fd
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue