mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 09:58:12 +02:00
bo: Free event_y in case of error to prevent memory leak (CID ##1160682)
If the call to _cairo_malloc_ab_plus_c() fails, it returns an error without first freeing event_y. Coverity ID: #1160682 Signed-off-by: Bryce Harrington <bryce@bryceharrington.org> Reviewed-By: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
1c3ecfac13
commit
9c56502e06
1 changed files with 4 additions and 1 deletions
|
|
@ -1501,8 +1501,11 @@ _cairo_bentley_ottmann_tessellate_polygon (cairo_traps_t *traps,
|
|||
sizeof (cairo_bo_start_event_t) +
|
||||
sizeof (cairo_bo_event_t *),
|
||||
sizeof (cairo_bo_event_t *));
|
||||
if (unlikely (events == NULL))
|
||||
if (unlikely (events == NULL)) {
|
||||
if (event_y != stack_event_y)
|
||||
free (event_y);
|
||||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
}
|
||||
|
||||
event_ptrs = (cairo_bo_event_t **) (events + num_events);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue