[cairo] Memory leak in recent multi-page support for SVG

Carl Worth cworth at cworth.org
Mon Nov 20 16:21:13 PST 2006

If people hadn't noticed yet, Emmanuel Pacaud just committed some
pretty cool support to the SVG backend to allow it to use SVG 1.2's
multi-page functionality, (with pageSet and page nodes in the output).

This is nice stuff, (though it would be even nicer if I had a viewer
that supported it---would be nice to be able to use evince+librsvg to
verify the output of our multi-page fallback-resolution test for

But I noticed that there's at least one memory leak in this code as
found by valgrind on a test from the test suite.

The valgrind report on the leak is below. I glanced at the relevant
code, but didn't explore it enough to be able to fix the bug.


==4158== 240 bytes in 6 blocks are definitely lost in loss record 9 of 19
==4158==    at 0x401C4A1: malloc (vg_replace_malloc.c:149)
==4158==    by 0x403FB22: _cairo_memory_stream_create (cairo-output-stream.c:509)
==4158==    by 0x404E72A: _cairo_svg_surface_store_page (cairo-svg-surface.c:437)
==4158==    by 0x404E7DD: _cairo_svg_surface_show_page (cairo-svg-surface.c:473)
==4158==    by 0x4038104: _cairo_surface_show_page (cairo-surface.c:1515)
==4158==    by 0x4042844: _cairo_paginated_surface_show_page (cairo-paginated-surface.c:316)
==4158==    by 0x4038104: _cairo_surface_show_page (cairo-surface.c:1515)
==4158==    by 0x402D2D6: _cairo_gstate_show_page (cairo-gstate.c:1049)
==4158==    by 0x402883F: cairo_show_page (cairo.c:2000)
==4158==    by 0x804B0C4: cairo_test_expecting (cairo-test.c:290)
==4158==    by 0x804A12C: main (big-trap.c:59)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20061120/3b2f0172/attachment.pgp

More information about the cairo mailing list