Closed Bug 1334079 Opened 3 years ago Closed 3 years ago

[Static Analysis][Resource leak] In function ClearKeySessionManager::CreateSession

Categories

(Core :: Audio/Video: GMP, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: CID 1399510)

Attachments

(1 file)

The Static Analysis tool Coverity detected that a memory leak may occur in the event when Init fails:

>>  if (!session->Init(aInitDataType, aInitData, aInitDataSize)) {
>>
>>    CK_LOGD("Failed to initialize session: %s", sessionId.c_str());
>>
>>    const static char* message = "Failed to initialize session";
>>    mHost->OnRejectPromise(aPromiseId,
>>                           Error::kUnknownError,
>>                           0,
>>                           message,
>>                           strlen(message));
>>
>>    return;
>>  }
Comment on attachment 8830689 [details]
Bug 1334079 - prevent memory leak in CreateSession.

https://reviewboard.mozilla.org/r/107420/#review108766

Thanks!
Attachment #8830689 - Flags: review?(cpearce) → review+
Pushed by bpostelnicu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7450881da187
prevent memory leak in CreateSession. r=cpearce
Rank: 17
Priority: -- → P1
Rank: 17
Component: Audio/Video → Audio/Video: GMP
Priority: P1 → --
Rank: 25
Priority: -- → P2
https://hg.mozilla.org/mozilla-central/rev/7450881da187
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.