#12706 closed bug (fixed)
BParameterGroup::Unflatten() leaks fName
Reported by: | ttcoder | Owned by: | Barrett |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Kits/Media Kit | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
This sequence.. http://xref.plausible.coop/source/xref/haiku/src/kits/media/ParameterWeb.cpp#623
creates a new BParameterGroup and immediately calls Unflatten() on it.. But Unflatten() is not a well behaved citizen
This means the original fName ("unnamed") is leaked, losing 8 bytes whenever the playback volume is queried or set
Change History (4)
comment:2 by , 9 years ago
I don't have much more to add, I think your proposed solution is OK. I'm going to test it though before to commit the fix. Thanks for reporting those issues!
Note:
See TracTickets
for help on using tickets.
Details:
The call to read_string_from_buffer() assigns it a new malloc()ed block without freeing the original alloc from the ctor
And thus the one from the ctor is leaked, and appears in leak_analyzer.sh outputs like this:
read_string_from_buffer() should probably
free(*_string)
before assining the new value*_string = string;
I'm tracking bigger leaks, but getting my feet wet with this easy one first. Let's see if this gets a response...