Commit 81c0e1ea authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

rpcrt4: Reorder code to make sure RpcBindingFromStringBinding[AW] cleans up (coverity).

parent 7c381e59
......@@ -851,10 +851,16 @@ RPC_STATUS WINAPI RpcBindingFromStringBindingA( RPC_CSTR StringBinding, RPC_BIND
if (ret == RPC_S_OK)
ret = RPCRT4_CreateBindingA(&bind, FALSE, (char*)Protseq);
if (ret != RPC_S_OK) return ret;
ret = RPCRT4_SetBindingObject(bind, &Uuid);
if (ret == RPC_S_OK)
ret = RPCRT4_CompleteBindingA(bind, (char*)NetworkAddr, (char*)Endpoint, (char*)Options);
if (ret == RPC_S_OK) {
ret = RPCRT4_SetBindingObject(bind, &Uuid);
if (ret == RPC_S_OK)
ret = RPCRT4_CompleteBindingA(bind, (char*)NetworkAddr, (char*)Endpoint, (char*)Options);
if (ret == RPC_S_OK)
*Binding = (RPC_BINDING_HANDLE)bind;
else
RPCRT4_ReleaseBinding(bind);
}
RpcStringFreeA(&Options);
RpcStringFreeA(&Endpoint);
......@@ -862,11 +868,6 @@ RPC_STATUS WINAPI RpcBindingFromStringBindingA( RPC_CSTR StringBinding, RPC_BIND
RpcStringFreeA(&Protseq);
RpcStringFreeA(&ObjectUuid);
if (ret == RPC_S_OK)
*Binding = (RPC_BINDING_HANDLE)bind;
else
RPCRT4_ReleaseBinding(bind);
return ret;
}
......@@ -890,10 +891,16 @@ RPC_STATUS WINAPI RpcBindingFromStringBindingW( RPC_WSTR StringBinding, RPC_BIND
if (ret == RPC_S_OK)
ret = RPCRT4_CreateBindingW(&bind, FALSE, Protseq);
if (ret != RPC_S_OK) return ret;
ret = RPCRT4_SetBindingObject(bind, &Uuid);
if (ret == RPC_S_OK)
ret = RPCRT4_CompleteBindingW(bind, NetworkAddr, Endpoint, Options);
if (ret == RPC_S_OK) {
ret = RPCRT4_SetBindingObject(bind, &Uuid);
if (ret == RPC_S_OK)
ret = RPCRT4_CompleteBindingW(bind, NetworkAddr, Endpoint, Options);
if (ret == RPC_S_OK)
*Binding = (RPC_BINDING_HANDLE)bind;
else
RPCRT4_ReleaseBinding(bind);
}
RpcStringFreeW(&Options);
RpcStringFreeW(&Endpoint);
......@@ -901,11 +908,6 @@ RPC_STATUS WINAPI RpcBindingFromStringBindingW( RPC_WSTR StringBinding, RPC_BIND
RpcStringFreeW(&Protseq);
RpcStringFreeW(&ObjectUuid);
if (ret == RPC_S_OK)
*Binding = (RPC_BINDING_HANDLE)bind;
else
RPCRT4_ReleaseBinding(bind);
return ret;
}
......
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