[cairo-commit] src/cairo-xlib-surface.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Aug 7 17:49:16 PDT 2008


 src/cairo-xlib-surface.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 5bac12252c79ea017457222b3cda2b82c8c33702
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Aug 8 01:47:36 2008 +0100

    [xlib] Free regions on failure.
    
    Fix leak of regions along error path.

diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index b7ede3a..36494a1 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -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));


More information about the cairo-commit mailing list