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:
nisheeth%netscape.com 1999-06-16 01:29:27 +00:00
parent 849596767d
commit 8f16f22564
3 changed files with 9 additions and 9 deletions

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}