[cairo] How to free a buffer when subset PS Type1 generation is failed?

Chris Wilson chris at chris-wilson.co.uk
Fri Jan 8 04:05:29 PST 2010


On Fri, 8 Jan 2010 13:31:59 +0900, mpsuzuki at hiroshima-u.ac.jp wrote:
> Now I'm playing with pdftoppm (poppler utils) to attach
> a shell-like interface, to cropping many fragments from
> a signe huge PDF. During the development, I found a
> problem that cairo_type1_font_subset_generate() does not
> free a buffer allocated by _cairo_output_stream_create()
> in some case, and it behaves like a memory leak during
> PDF generation. I want to ask the appropriate method to
> free it.

Thanks for reporting this bug, it looks like we never actually destroy the
stream along the normal path either.

commit 4204605813d93e7e2f0d8761e90a6dd6b8089dcb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jan 8 11:58:15 2010 +0000

    type1: Destroy the output stream.
    
    mpsuzuki spotted that the output stream for the subset was not being
    destroyed on the error path - on closer inspection, it wasn't destroyed
    along the normal path either and may never have been correctly
    initialised to NULL on an earlier error.
    
    Reported-by: mpsuzuki at hiroshima-u.ac.jp
-ickle

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list