Skip to content

Fix a leak in the cairo-svg-glyph-renderer

Uli Schlachter requested to merge psychon/cairo:svg-glyph-renderer-leak into master

This svg

<svg /><path stroke-dasharray=""fill="url(# "id=""/>

Lead to two memory leaks like the following:

 98 bytes in 98 blocks are definitely lost in loss record 2 of 11
    at 0x48407B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x4EB8789: strdup (strdup.c:42)
    by 0x493C450: save_graphics_state (cairo-svg-glyph-render.c:2894)

This happened because the value of gs->dash_array was replaced without freeing the previous value. This commit adds the missing free and fixes the leak.

Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54830 Signed-off-by: Uli Schlachter psychon@znc.in

Merge request reports