Opened 3 years ago

Closed 3 years ago

#13126 closed bug (fixed)

[Patch] kits/media/PluginManager.cpp: fix memory leak

Reported by: mt Owned by: Barrett
Priority: normal Milestone: Unscheduled
Component: Kits/Media Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: yes Platform: All

Description

In PluginManager::CreateReader(), 'buffered_source' may leak at line 240 [1] if buffered_source->InitCheck() != B_OK. [1] http://cgit.haiku-os.org/haiku/tree/src/kits/media/PluginManager.cpp#n240

Attachments (2)

0038-PluginManager.cpp-fix-memory-leak.patch (888 bytes ) - added by mt 3 years ago.
report-97294d.html (96.6 KB ) - added by mt 3 years ago.
report by Clang Static Analyzer

Download all attachments as: .zip

Change History (6)

comment:1 by mt, 3 years ago

Has a Patch: set

by mt, 3 years ago

Attachment: report-97294d.html added

report by Clang Static Analyzer

comment:2 by Barrett, 3 years ago

Thanks for the patch!

InitCheck was originally included in the BAdapterIO API and was then dropped and it's actually doing nothing.

The real fix here is to remove completely the InitCheck() function from BMediaIOWrapper and the check in PluginManager.

comment:3 by Barrett, 3 years ago

Are you willing to submit an updated patch? Otherwise I'd have to close this ticket and do the work myself.

comment:4 by Barrett, 3 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev51004.

Note: See TracTickets for help on using tickets.