mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 16:58:01 +02:00
[xlib] Free regions on failure.
Fix leak of regions along error path.
This commit is contained in:
parent
16939e1a86
commit
5bac12252c
1 changed files with 5 additions and 2 deletions
|
|
@ -2171,8 +2171,11 @@ _cairo_xlib_surface_set_clip_region (void *abstract_surface,
|
|||
}
|
||||
|
||||
status = _cairo_region_get_boxes (&bounded, &n_boxes, &boxes);
|
||||
if (status)
|
||||
return status;
|
||||
if (status) {
|
||||
_cairo_region_fini (&bound);
|
||||
_cairo_region_fini (&bounded);
|
||||
return status;
|
||||
}
|
||||
|
||||
if (n_boxes > ARRAY_LENGTH (surface->embedded_clip_rects)) {
|
||||
rects = _cairo_malloc_ab (n_boxes, sizeof (XRectangle));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue