mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Fixed a crash that resulted from trying to access freed memory in CSSLoaderImpl::DidLoadStyle(). I was trying to access aLoadData to print out an error message after aLoadData had been freed. Moved the error printing code to where aLoadData still has valid content.
This commit is contained in:
parent
849596767d
commit
8f16f22564
@ -749,9 +749,6 @@ CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader,
|
||||
}
|
||||
}
|
||||
else { // load failed, cleanup
|
||||
URLKey key(aLoadData->mURL);
|
||||
Cleanup(key, aLoadData);
|
||||
|
||||
// Dump error message to console.
|
||||
const char *url;
|
||||
if (nsnull != aLoadData->mURL)
|
||||
@ -760,6 +757,9 @@ CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader,
|
||||
url = "";
|
||||
cerr << "CSSLoaderImpl::DidLoadStyle: Load of URL '" << url
|
||||
<< "' failed. Error code: " << NS_ERROR_GET_CODE(aStatus) << "\n";
|
||||
|
||||
URLKey key(aLoadData->mURL);
|
||||
Cleanup(key, aLoadData);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -749,9 +749,6 @@ CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader,
|
||||
}
|
||||
}
|
||||
else { // load failed, cleanup
|
||||
URLKey key(aLoadData->mURL);
|
||||
Cleanup(key, aLoadData);
|
||||
|
||||
// Dump error message to console.
|
||||
const char *url;
|
||||
if (nsnull != aLoadData->mURL)
|
||||
@ -760,6 +757,9 @@ CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader,
|
||||
url = "";
|
||||
cerr << "CSSLoaderImpl::DidLoadStyle: Load of URL '" << url
|
||||
<< "' failed. Error code: " << NS_ERROR_GET_CODE(aStatus) << "\n";
|
||||
|
||||
URLKey key(aLoadData->mURL);
|
||||
Cleanup(key, aLoadData);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -749,9 +749,6 @@ CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader,
|
||||
}
|
||||
}
|
||||
else { // load failed, cleanup
|
||||
URLKey key(aLoadData->mURL);
|
||||
Cleanup(key, aLoadData);
|
||||
|
||||
// Dump error message to console.
|
||||
const char *url;
|
||||
if (nsnull != aLoadData->mURL)
|
||||
@ -760,6 +757,9 @@ CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader,
|
||||
url = "";
|
||||
cerr << "CSSLoaderImpl::DidLoadStyle: Load of URL '" << url
|
||||
<< "' failed. Error code: " << NS_ERROR_GET_CODE(aStatus) << "\n";
|
||||
|
||||
URLKey key(aLoadData->mURL);
|
||||
Cleanup(key, aLoadData);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user