Closed
Bug 1410689
Opened 7 years ago
Closed 7 years ago
[CID 1419987] Leak in GMPContentChild::RecvPChromiumCDMConstructor()
Categories
(Core :: Audio/Video: GMP, defect)
Tracking
()
RESOLVED
FIXED
mozilla58
Tracking | Status | |
---|---|---|
firefox-esr52 | --- | unaffected |
firefox56 | --- | unaffected |
firefox57 | --- | unaffected |
firefox58 | --- | fixed |
People
(Reporter: jesup, Assigned: JamesCheng)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, memory-leak, Whiteboard: [CID 1419987])
Attachments
(1 file)
If err isn'g GMPNoErr, we'll leak a cdm structure. I suggest moving the 'if' up to before 'new'.
** CID 1419987: Resource leaks (RESOURCE_LEAK)
/dom/media/gmp/GMPContentChild.cpp: 303 in mozilla::gmp::GMPContentChild::RecvPChromiumCDMConstructor(mozilla::gmp::PChromiumCDMChild *)()
________________________________________________________________________________________________________
*** CID 1419987: Resource leaks (RESOURCE_LEAK)
/dom/media/gmp/GMPContentChild.cpp: 303 in mozilla::gmp::GMPContentChild::RecvPChromiumCDMConstructor(mozilla::gmp::PChromiumCDMChild *)()
297 cdm =
298 new ChromiumCDM8BackwardsCompat(
299 host9,
300 static_cast<cdm::ContentDecryptionModule_8*>(cdm));
301 if (err != GMPNoErr) {
302 NS_WARNING("GMPGetAPI call failed trying to get CDM.");
>>> CID 1419987: Resource leaks (RESOURCE_LEAK)
>>> Variable "cdm" going out of scope leaks the storage it points to.
303 return IPC_FAIL_NO_REASON(this);
304 }
305 }
306
307 child->Init(static_cast<cdm::ContentDecryptionModule_9*>(cdm));
308
Assignee | ||
Comment 1•7 years ago
|
||
Thank you, I will fix it soon.
Summary: Leak in GMPContentChild::RecvPChromiumCDMConstructor() → [CID 1419987] Leak in GMPContentChild::RecvPChromiumCDMConstructor()
Comment hidden (mozreview-request) |
Comment 3•7 years ago
|
||
mozreview-review |
Comment on attachment 8920932 [details]
Bug 1410689 - Early return before creating ChromiumCDM8BackwardsCompat to avoid leak.
https://reviewboard.mozilla.org/r/191872/#review197046
Attachment #8920932 -
Flags: review?(gsquelart) → review+
Pushed by jacheng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d936c6da5ff3
Early return before creating ChromiumCDM8BackwardsCompat to avoid leak. r=gerald
Comment 5•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Updated•7 years ago
|
status-firefox56:
--- → unaffected
status-firefox57:
--- → unaffected
status-firefox-esr52:
--- → unaffected
Updated•7 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•