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

This commit is contained in:
André Hentschel 2012-10-28 16:16:56 +01:00 committed by Alexandre Julliard
parent 7c381e59c4
commit 81c0e1eaa1

View File

@ -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;
}