Opened 11 years ago

Closed 11 years ago

#10232 closed bug (fixed)

Minor memory leak fix in media kit ParameterWeb

Reported by: Ceann Owned by: axeld
Priority: normal Milestone: R1
Component: Kits/Media Kit Version: R1/Development
Keywords: gci2013 Cc:
Blocked By: Blocking:
Platform: All

Description

in src/kits/media/ParameterWeb.cpp:2030: BDiscreteParameter::AddItem currently returns without freeing nameCopy. (detected by Coverity, CID 992460)

Fixed by freeing nameCopy.

Attachments (1)

0001-Fixed-resource-leak-line-2023-nameCopy-not-freed.patch (851 bytes ) - added by Ceann 11 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by Ceann, 11 years ago

patch: 01

comment:2 by umccullough, 11 years ago

Component: - GeneralKits/Media Kit
Owner: changed from nobody to axeld

comment:3 by anevilyak, 11 years ago

While this is correct as far as the CID is concerned, it's not entirely complete: in the case where fValues->AddItem() succeeds, but fSelections->AddItem() fails, it should remove the value, and free it in addition to nameCopy. Otherwise, the state of the parameter object will be inconsistent after the call returns. Coverity won't detect that though, since the added value will ultimately be freed by the destructor either way.

Last edited 11 years ago by anevilyak (previous) (diff)

comment:4 by korli, 11 years ago

Resolution: fixed
Status: newclosed

Applied a fix in hrev46427.

Note: See TracTickets for help on using tickets.