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

Carl Worth cworth at kemper.freedesktop.org
Mon Mar 13 12:17:02 PST 2006


 src/cairo-pdf-surface.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

New commits:
diff-tree fc51a78a1ed5f7649ce55ab30fc42939a9b295d1 (from 25cccaaa1f6d337a1a0423a298f94456e72a820a)
Author: Carl Worth <cworth at cworth.org>
Date:   Mon Mar 13 12:14:47 2006 -0800

    cairo-pdf-surface: Close memory leak during OOM handling.
    
    This fixes bug #6186:
    
    	Memory leak in emit_image_rgb_data (src/cairo-pdf-surface.c)
    	https://bugs.freedesktop.org/show_bug.cgi?id=6186

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index cb8287b..6d18196 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -654,8 +654,10 @@ emit_image_rgb_data (cairo_pdf_document_
 	opaque = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
 					     image->width,
 					     image->height);
-	if (opaque->status)
+	if (opaque->status) {
+	    free (rgb);
 	    return 0;
+	}
     
 	_cairo_pattern_init_for_surface (&pattern.surface, &image->base);
     


More information about the cairo-commit mailing list