From valgrind: ==15828== 1024 bytes in 1 blocks are definitely lost in loss record 1076 of 1133 ==15828== at 0x1B9043DA: malloc (vg_replace_malloc.c:214) ==15828== by 0x1C34584C: gmalloc (gmem.c:89) ==15828== by 0x1C2D6D5A: CairoFont::CairoFont(GfxFont*, XRef*, FT_LibraryRec_*) (CairoFontEngine.cc:173) ==15828== by 0x1C2D71BB: CairoFontEngine::getFont(GfxFont*, XRef*) (CairoFontEngine.cc:379) ==15828== by 0x1C2D7F03: CairoOutputDev::updateFont(GfxState*) (CairoOutputDev.cc:227) ==15828== by 0x1C2EBA2D: Gfx::doShowText(GooString*) (Gfx.cc:2320) ==15828== by 0x1C2EBEBF: Gfx::opShowText(Object*, int) (Gfx.cc:2238) ==15828== by 0x1C2E8EB2: Gfx::execOp(Object*, Object*, int) (Gfx.cc:660) ==15828== by 0x1C2E90DE: Gfx::go(int) (Gfx.cc:551) ==15828== by 0x1C2E9B0E: Gfx::display(Object*, int) (Gfx.cc:523) ==15828== by 0x1C324EA1: Page::displaySlice(OutputDev*, double, double, int, int, int, int, int, int, Links*, Catalog*, int (*)(void*), void*, int (*)(Annot*, void*), void*) (Page.cc:344) ==15828== by 0x1C2927A7: poppler_page_render_to_pixbuf (poppler-page.cc:182) ==15828== by 0x804D848: make_thumbnail_for_size(_PdfDocument*, int, int, int) (ev-poppler.cc:822) ==15828== by 0x804D94C: pdf_document_thumbnails_get_thumbnail(_EvDocumentThumbnails*, int, int, int) (ev-poppler.cc:857) ==15828== by 0x80513D4: ev_document_thumbnails_get_thumbnail (ev-document-thumbnails.c:58) ==15828== by 0x804C18D: main (evince-thumbnailer.c:60)
Created attachment 2968 [details] [review] Whops... :)
gfree already does the if(foo) free(foo) test so no need to do it again, the patch should be only gfree(codeToGID);
maybe an additional codeToGID = NULL; is needed on line 232 so that no double freeing is done in that case
(In reply to comment #3) > maybe an additional > codeToGID = NULL; > is needed on line 232 so that no double freeing is done in that case Nah, we're gfree()'ing it in the destructor, if that gets called twice for the same object we have bigger problems. Please commit.
Fix committed, closing bug.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.