Bugs item #1948101, was opened at 2008-04-21 10:09
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100290&aid=1948101&group_id=290Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Memory not freed (lame-3.97, lame-3.98b8)
Initial Comment:
File:
libmp3lame/lame.c
Functions:
lame_global_flags * lame_init(void)
int lame_init_old(lame_global_flags * gfp)
int lame_close(lame_global_flags * gfp)
a call to lame_init() allocates two chunks of memory worth 616+142032 bytes on my system:
first:
gfp = calloc(1, sizeof(lame_global_flags));
then:
gfc = gfp->internal_flags = calloc(1, sizeof(lame_internal_flags)))
in lame_init_old
If the developer never calls lame_init_params() on this object,
then the following test in lame_close() will be satisfied:
if (NULL == gfc || gfc->Class_ID != LAME_ID)
and therefore those two bits of memory will never be freed.
My suggestion is to split this test:
. if gfc == NULL then nothing and return (as it is now)
. if gfc->Class_ID != LAME ID then just free gfp->internal_flags and gfp and return
(I noticed this with Valgrind.)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100290&aid=1948101&group_id=290-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone_______________________________________________
Lame-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/lame-dev