Opened 6 years ago

Closed 6 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:
Has a Patch: yes 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 6 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 6 years ago by Ceann

Has a Patch: set

comment:2 Changed 6 years ago by umccullough

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

comment:3 Changed 6 years ago by anevilyak

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 6 years ago by anevilyak (previous) (diff)

comment:4 Changed 6 years ago by korli

Resolution: fixed
Status: newclosed

Applied a fix in hrev46427.

Note: See TracTickets for help on using tickets.