mshtml: Fixed a few coverity issues.

This commit is contained in:
Jacek Caban 2012-11-27 12:16:34 +01:00 committed by Alexandre Julliard
parent 71d185d7fe
commit df53b50171
5 changed files with 28 additions and 14 deletions

View file

@ -800,15 +800,16 @@ HRESULT start_binding(HTMLInnerWindow *inner_window, BSCallback *bscallback, IBi
/* NOTE: IE7 calls IsSystemMoniker here*/
if(bctx) {
RegisterBindStatusCallback(bctx, &bscallback->IBindStatusCallback_iface, NULL, 0);
IBindCtx_AddRef(bctx);
hres = RegisterBindStatusCallback(bctx, &bscallback->IBindStatusCallback_iface, NULL, 0);
if(SUCCEEDED(hres))
IBindCtx_AddRef(bctx);
}else {
hres = CreateAsyncBindCtx(0, &bscallback->IBindStatusCallback_iface, NULL, &bctx);
if(FAILED(hres)) {
WARN("CreateAsyncBindCtx failed: %08x\n", hres);
bscallback->vtbl->stop_binding(bscallback, hres);
return hres;
}
}
if(FAILED(hres)) {
bscallback->vtbl->stop_binding(bscallback, hres);
return hres;
}
hres = IMoniker_BindToStorage(bscallback->mon, bctx, NULL, &IID_IStream, (void**)&str);
@ -1473,7 +1474,6 @@ static void handle_navigation_error(nsChannelBSC *This, DWORD result)
return;
if(!doc->client_cmdtrg)
if(FAILED(hres))
return;
bound.lLbound = 0;

View file

@ -280,6 +280,7 @@ static nsresult NSAPI nsDirectoryServiceProvider2_GetFile(nsIDirectoryServicePro
return nsres;
}
assert(profile_directory != NULL);
return nsIFile_Clone(profile_directory, _retval);
}

View file

@ -1042,10 +1042,16 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
return NS_ERROR_FAILURE;
if(TRACE_ON(mshtml)) {
HRESULT hres;
BSTR uri_str;
IUri_GetDisplayUri(This->uri->uri, &uri_str);
TRACE("opening %s\n", debugstr_w(uri_str));
SysFreeString(uri_str);
hres = IUri_GetDisplayUri(This->uri->uri, &uri_str);
if(SUCCEEDED(hres)) {
TRACE("opening %s\n", debugstr_w(uri_str));
SysFreeString(uri_str);
}else {
WARN("GetDisplayUri failed: %08x\n", hres);
}
}
if(This->uri->is_doc_uri) {

View file

@ -1301,8 +1301,10 @@ static HRESULT WINAPI PHInPlaceSite_GetWindowContext(IOleInPlaceSiteEx *iface,
return hres;
hres = create_ip_window(ppDoc);
if(FAILED(hres))
if(FAILED(hres)) {
IOleInPlaceFrame_Release(ip_frame);
return hres;
}
*ppFrame = ip_frame;
*lprcPosRect = This->rect;

View file

@ -218,6 +218,7 @@ static HRESULT WINAPI AboutProtocol_Start(IInternetProtocol *iface, LPCWSTR szUr
LPCWSTR text = NULL;
DWORD data_len;
BYTE *data;
HRESULT hres;
static const WCHAR html_begin[] = {0xfeff,'<','H','T','M','L','>',0};
static const WCHAR html_end[] = {'<','/','H','T','M','L','>',0};
@ -237,7 +238,9 @@ static HRESULT WINAPI AboutProtocol_Start(IInternetProtocol *iface, LPCWSTR szUr
memset(&bindinfo, 0, sizeof(bindinfo));
bindinfo.cbSize = sizeof(BINDINFO);
IInternetBindInfo_GetBindInfo(pOIBindInfo, &grfBINDF, &bindinfo);
hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &grfBINDF, &bindinfo);
if(FAILED(hres))
return hres;
ReleaseBindInfo(&bindinfo);
TRACE("bindf %x\n", grfBINDF);
@ -605,7 +608,9 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
memset(&bindinfo, 0, sizeof(bindinfo));
bindinfo.cbSize = sizeof(BINDINFO);
IInternetBindInfo_GetBindInfo(pOIBindInfo, &grfBINDF, &bindinfo);
hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &grfBINDF, &bindinfo);
if(FAILED(hres))
return hres;
ReleaseBindInfo(&bindinfo);
len = strlenW(szUrl)+16;