bugThe FreeType Project - Bugs: bug #37941, memory leak in FT_Glyph_To_Bitmap

 
 

bug #37941: memory leak in FT_Glyph_To_Bitmap

Submitted by:  None
Submitted on:  Mon 17 Dec 2012 10:18:53 AM UTC  
 
Severity: 3 - NormalItem Group: None
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.4.11

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 18 Dec 2012 12:41:31 PM UTC, comment #2:

You're right. Sorry for not checking the current git tree more carefully.

Anonymous
Tue 18 Dec 2012 08:30:31 AM UTC, comment #1:

I think this has already been fixed with commit e7454a47 (from 2012-07-11):

[smooth] Avoid memory leak in case of failure.

Please check.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Mon 17 Dec 2012 10:18:53 AM UTC, original submission:

FT_Glyph_To_Bitmap leaks memory if ft_smooth_render_generic fails after allocating the bitmap buffer. In that case, at the end of
FT_Glyph_To_Bitmap dummy.bitmap.buffer is non-NULL and dummy.internals->flags has the FT_GLYPH_OWN_BITMAP bit set. It seems that adding the following (or whatever the nicer equivalent of properly freeing a bitmap is) to FT_Glyph_To_Bitmap after the "Exit" label fixes the leak:

if (error && (dummy.internals->flags & FT_GLYPH_OWN_BITMAP))
{
FT_Memory memory = library->memory;
FT_FREE(dummy.bitmap.buffer);
}

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by wl (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 18 Dec 2012 08:30:31 AM UTCwlStatusNone=>Fixed
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.4.11

    Back to the top


    Powered by Savane 3.1-cleanup1