NECKO change only --> if we failed to get a content type we would crash because we were executing code even if
the return value was failure that dependend on the content type ptr being valid. git-svn-id: svn://10.0.0.236/trunk@38935 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
e8399506b9
commit
afbb4fb824
@ -1060,13 +1060,16 @@ nsresult nsParser::OnStartRequest(nsIURI* aURL, const char *aSourceType)
|
||||
mParserContext->mDTD=0;
|
||||
#ifdef NECKO
|
||||
nsresult rv;
|
||||
char* contentType;
|
||||
char* contentType = nsnull;
|
||||
rv = channel->GetContentType(&contentType);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_ASSERTION(contentType, "parser needs a content type to find a dtd");
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
mParserContext->mSourceType = contentType;
|
||||
nsCRT::free(contentType);
|
||||
}
|
||||
mParserContext->mSourceType = contentType;
|
||||
nsCRT::free(contentType);
|
||||
else
|
||||
NS_ASSERTION(contentType, "parser needs a content type to find a dtd");
|
||||
|
||||
#else
|
||||
mParserContext->mSourceType=aSourceType;
|
||||
#endif
|
||||
|
||||
@ -1060,13 +1060,16 @@ nsresult nsParser::OnStartRequest(nsIURI* aURL, const char *aSourceType)
|
||||
mParserContext->mDTD=0;
|
||||
#ifdef NECKO
|
||||
nsresult rv;
|
||||
char* contentType;
|
||||
char* contentType = nsnull;
|
||||
rv = channel->GetContentType(&contentType);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_ASSERTION(contentType, "parser needs a content type to find a dtd");
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
mParserContext->mSourceType = contentType;
|
||||
nsCRT::free(contentType);
|
||||
}
|
||||
mParserContext->mSourceType = contentType;
|
||||
nsCRT::free(contentType);
|
||||
else
|
||||
NS_ASSERTION(contentType, "parser needs a content type to find a dtd");
|
||||
|
||||
#else
|
||||
mParserContext->mSourceType=aSourceType;
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user