Commit 48cebe2b authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

msxml3: Do not leak bind context on error paths (Coverity).

parent 2e23904a
...@@ -680,19 +680,12 @@ static const IAuthenticateVtbl AuthenticateVtbl = { ...@@ -680,19 +680,12 @@ static const IAuthenticateVtbl AuthenticateVtbl = {
static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback **obj, const VARIANT *body) static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback **obj, const VARIANT *body)
{ {
BindStatusCallback *bsc; BindStatusCallback *bsc;
IBindCtx *pbc; IBindCtx *pbc = NULL;
HRESULT hr; HRESULT hr;
LONG size; LONG size;
hr = CreateBindCtx(0, &pbc); if (!(bsc = heap_alloc(sizeof(*bsc))))
if (hr != S_OK) return hr;
bsc = heap_alloc(sizeof(*bsc));
if (!bsc)
{
IBindCtx_Release(pbc);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
}
bsc->IBindStatusCallback_iface.lpVtbl = &BindStatusCallbackVtbl; bsc->IBindStatusCallback_iface.lpVtbl = &BindStatusCallbackVtbl;
bsc->IHttpNegotiate_iface.lpVtbl = &BSCHttpNegotiateVtbl; bsc->IHttpNegotiate_iface.lpVtbl = &BSCHttpNegotiateVtbl;
...@@ -795,7 +788,9 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback * ...@@ -795,7 +788,9 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback *
SafeArrayUnaccessData(sa); SafeArrayUnaccessData(sa);
} }
hr = RegisterBindStatusCallback(pbc, &bsc->IBindStatusCallback_iface, NULL, 0); hr = CreateBindCtx(0, &pbc);
if (hr == S_OK)
hr = RegisterBindStatusCallback(pbc, &bsc->IBindStatusCallback_iface, NULL, 0);
if (hr == S_OK) if (hr == S_OK)
{ {
IMoniker *moniker; IMoniker *moniker;
...@@ -809,9 +804,11 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback * ...@@ -809,9 +804,11 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback *
IMoniker_Release(moniker); IMoniker_Release(moniker);
if (stream) IStream_Release(stream); if (stream) IStream_Release(stream);
} }
IBindCtx_Release(pbc);
} }
if (pbc)
IBindCtx_Release(pbc);
if (FAILED(hr)) if (FAILED(hr))
{ {
IBindStatusCallback_Release(&bsc->IBindStatusCallback_iface); IBindStatusCallback_Release(&bsc->IBindStatusCallback_iface);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment