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 = {
static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback **obj, const VARIANT *body)
{
BindStatusCallback *bsc;
IBindCtx *pbc;
IBindCtx *pbc = NULL;
HRESULT hr;
LONG size;
hr = CreateBindCtx(0, &pbc);
if (hr != S_OK) return hr;
bsc = heap_alloc(sizeof(*bsc));
if (!bsc)
{
IBindCtx_Release(pbc);
if (!(bsc = heap_alloc(sizeof(*bsc))))
return E_OUTOFMEMORY;
}
bsc->IBindStatusCallback_iface.lpVtbl = &BindStatusCallbackVtbl;
bsc->IHttpNegotiate_iface.lpVtbl = &BSCHttpNegotiateVtbl;
......@@ -795,7 +788,9 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback *
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)
{
IMoniker *moniker;
......@@ -809,9 +804,11 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback *
IMoniker_Release(moniker);
if (stream) IStream_Release(stream);
}
IBindCtx_Release(pbc);
}
if (pbc)
IBindCtx_Release(pbc);
if (FAILED(hr))
{
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