Bug 3586 - Leak in CairoFontEngine.cc:173
Summary: Leak in CairoFontEngine.cc:173
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Kristian Høgsberg
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-21 06:00 UTC by Kjartan Maraas
Modified: 2005-07-26 23:00 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Kjartan Maraas 2005-06-21 06:00:26 UTC
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)
Comment 1 Martin Kretzschmar 2005-06-26 05:20:26 UTC
Created attachment 2968 [details] [review]
Whops... :)
Comment 2 Albert Astals Cid 2005-07-21 23:20:10 UTC
gfree already does the if(foo) free(foo) test so no need to do it again, the  
patch should be only   
gfree(codeToGID); 
Comment 3 Albert Astals Cid 2005-07-21 23:26:19 UTC
maybe an additional   
codeToGID = NULL; 
is needed on line 232 so that no double freeing is done in that case 
Comment 4 Kristian Høgsberg 2005-07-22 10:17:00 UTC
(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.
Comment 5 Kristian Høgsberg 2005-07-28 09:00:51 UTC
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.