mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 982072 - Don't leak the argument passed to RegisterStrongMemoryReporter if we fail to get the service; r=froydnj
This commit is contained in:
parent
1dd06e308b
commit
7e1e6e5ff9
@ -1741,12 +1741,16 @@ namespace mozilla {
|
||||
nsresult
|
||||
RegisterStrongMemoryReporter(nsIMemoryReporter* aReporter)
|
||||
{
|
||||
// Hold a strong reference to the argument to make sure it gets released if
|
||||
// we return early below.
|
||||
nsCOMPtr<nsIMemoryReporter> reporter = aReporter;
|
||||
|
||||
nsCOMPtr<nsIMemoryReporterManager> mgr =
|
||||
do_GetService("@mozilla.org/memory-reporter-manager;1");
|
||||
if (!mgr) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
return mgr->RegisterStrongReporter(aReporter);
|
||||
return mgr->RegisterStrongReporter(reporter);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
Loading…
Reference in New Issue
Block a user