[librsvg] Plug a refount leak



commit f0621f3aca35df40370e8ad8c827d8a016214840
Author: Christian Persch <chpe gnome org>
Date:   Sat Dec 3 18:31:46 2011 +0100

    Plug a refount leak
    
    ==9147== 691,200 bytes in 1 blocks are possibly lost in loss record 5,494 of 5,494
    ==9147==    at 0x4029467: calloc (vg_replace_malloc.c:467)
    ==9147==    by 0x518BB09: _pixman_bits_image_init (pixman-bits-image.c:1437)
    ==9147==    by 0x518BBD7: pixman_image_create_bits (pixman-bits-image.c:1503)
    ==9147==    by 0x499CD4E: _cairo_image_surface_create_with_pixman_format (cairo-image-surface.c:329)
    ==9147==    by 0x499CE14: cairo_image_surface_create (cairo-image-surface.c:379)
    ==9147==    by 0x403EA89: _rsvg_image_surface_new (rsvg-filter.c:160)
    ==9147==    by 0x404112B: rsvg_filter_primitive_offset_render (rsvg-filter.c:1618)
    ==9147==    by 0x4049D6F: rsvg_filter_render (rsvg-filter.c:86)
    
    ==9147== 460 (288 direct, 172 indirect) bytes in 1 blocks are definitely lost in loss record 5,205 of 5,494
    ==9147==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
    ==9147==    by 0x4999F1A: _cairo_image_surface_create_for_pixman_image (cairo-image-surface.c:158)
    ==9147==    by 0x499CD60: _cairo_image_surface_create_with_pixman_format (cairo-image-surface.c:335)
    ==9147==    by 0x499CE14: cairo_image_surface_create (cairo-image-surface.c:379)
    ==9147==    by 0x403EA89: _rsvg_image_surface_new (rsvg-filter.c:160)
    ==9147==    by 0x404112B: rsvg_filter_primitive_offset_render (rsvg-filter.c:1618)
    ==9147==    by 0x4049D6F: rsvg_filter_render (rsvg-filter.c:86)

 rsvg-filter.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/rsvg-filter.c b/rsvg-filter.c
index 9a24a8e..5dc59b4 100644
--- a/rsvg-filter.c
+++ b/rsvg-filter.c
@@ -4544,6 +4544,7 @@ rsvg_filter_primitive_tile_render (RsvgFilterPrimitive * self, RsvgFilterContext
 
     output = _rsvg_image_surface_new (ctx->width, ctx->height);
     if (output == NULL) {
+        cairo_surface_destroy (in);
         return;
     }
 
@@ -4565,6 +4566,7 @@ rsvg_filter_primitive_tile_render (RsvgFilterPrimitive * self, RsvgFilterContext
 
     rsvg_filter_store_result (self->result, output, ctx);
 
+    cairo_surface_destroy (in);
     cairo_surface_destroy (output);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]