[lokisetup] Memory leak fixes in setupdb and setup

Stephane Peter megastep at megastep.org
Fri Apr 30 17:48:11 EDT 2004

OK, i have to admit I didn't try out the changes before committing. I 
just spent a couple of days doing the exact same kind of changes to a 
lot of code, but errors slip by...

I agree this is potentially dangerous, but I'm rather inclined myself 
to do things right, at least fix the more obvious leaks. The leaks are 
actually a few bytes per tag, but unfortunately this is often code that 
is called often. Overall, yeah, the leaks are barely noticeable.

I'm gonna have to release an installer soon for my own purposes, so 
I'll run this through valgrind and debug any more problem I find...

On another topic, I also committed changes to detect Gentoo in setupdb. 

On Apr 30, 2004, at 12:25 AM, Ryan C. Gordon wrote:
>> Anyway, if you notice any weirdness in the current CVS snapshot, 
>> please
>> let me know.
> Ugh, just hit another bug in copy.c...look for the call to
> add_bin_entry()...we free "symlink", but add_bin_entry stores the
> pointer from libxml, so you dereference free()'d memory on the "Type
> '%s' to start the game" message.
> How much memory does libxml leak in the worst case? A few bytes per XML
> tag/attribute? I'm inclined to suggest you back out the change and let
> it leak, since this is just going to cause a lot of subtle bugs.
> Alternately, these are the sort of things valgrind should find...funny
> that valgrind spurred this change in the first place.  :)
> --ryan.
Stéphane Peter
megastep at megastep.org

More information about the Lokisetup mailing list