mshtml: Correctly handle NULL nschannel in channelbsc_load_stream (Coverity).

This commit is contained in:
Jacek Caban 2009-11-12 14:51:43 +01:00 committed by Alexandre Julliard
parent 03aae9e418
commit aa714ca169
1 changed files with 8 additions and 4 deletions

View File

@ -1142,13 +1142,17 @@ HRESULT channelbsc_load_stream(nsChannelBSC *bscallback, IStream *stream)
{
HRESULT hres;
const char text_html[] = "text/html";
if(!bscallback->nschannel) {
ERR("NULL nschannel\n");
return E_FAIL;
}
bscallback->nschannel->content_type = heap_strdupA("text/html");
if(!bscallback->nschannel->content_type)
return E_OUTOFMEMORY;
add_nsrequest(bscallback);
if(bscallback->nschannel)
bscallback->nschannel->content_type = heap_strdupA(text_html);
hres = read_stream_data(bscallback, stream);
IBindStatusCallback_OnStopBinding(STATUSCLB(&bscallback->bsc), hres, ERROR_SUCCESS);