Module: wine Branch: master Commit: 2211b6e5d0a31dfea39e27335eed5bb63cb16c25 URL: http://source.winehq.org/git/wine.git/?a=commit;h=2211b6e5d0a31dfea39e27335e...
Author: Rob Shearman rob@codeweavers.com Date: Tue Jun 12 10:09:44 2007 +0100
mshtml: Add some error handling to hlink_frame_navigate.
---
dlls/mshtml/navigate.c | 32 ++++++++++++++++++++++---------- 1 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index 2303baf..459cc63 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -744,6 +744,7 @@ void hlink_frame_navigate(HTMLDocument *doc, IHlinkFrame *hlink_frame, IBindCtx *bindctx; IMoniker *mon; IHlink *hlink; + HRESULT hr;
callback = create_bscallback(NULL);
@@ -754,24 +755,35 @@ void hlink_frame_navigate(HTMLDocument *doc, IHlinkFrame *hlink_frame, debugstr_an(callback->post_data, callback->post_data_len)); }
- CreateAsyncBindCtx(0, STATUSCLB(callback), NULL, &bindctx); + hr = CreateAsyncBindCtx(0, STATUSCLB(callback), NULL, &bindctx); + if (FAILED(hr)) { + IBindStatusCallback_Release(STATUSCLB(callback)); + return; + }
hlink = Hlink_Create(); + if (!hlink) { + IBindCtx_Release(bindctx); + IBindStatusCallback_Release(STATUSCLB(callback)); + return; + }
- CreateURLMoniker(NULL, uri, &mon); - IHlink_SetMonikerReference(hlink, 0, mon, NULL); + hr = CreateURLMoniker(NULL, uri, &mon); + if (SUCCEEDED(hr)) { + IHlink_SetMonikerReference(hlink, 0, mon, NULL);
- if(hlnf & HLNF_OPENINNEWWINDOW) { - static const WCHAR wszBlank[] = {'_','b','l','a','n','k',0}; - IHlink_SetTargetFrameName(hlink, wszBlank); /* FIXME */ - } + if(hlnf & HLNF_OPENINNEWWINDOW) { + static const WCHAR wszBlank[] = {'_','b','l','a','n','k',0}; + IHlink_SetTargetFrameName(hlink, wszBlank); /* FIXME */ + } + + IHlinkFrame_Navigate(hlink_frame, hlnf, bindctx, STATUSCLB(callback), hlink);
- IHlinkFrame_Navigate(hlink_frame, hlnf, bindctx, STATUSCLB(callback), hlink); + IMoniker_Release(mon); + }
IBindCtx_Release(bindctx); IBindStatusCallback_Release(STATUSCLB(callback)); - IMoniker_Release(mon); - }
HRESULT start_binding(BSCallback *bscallback)