rpcrt4: Don't crash with a NULL binding handle in RpcBindingFree.
This commit is contained in:
parent
b49512ecaf
commit
cdc10a8d3b
|
@ -785,8 +785,11 @@ RPC_STATUS WINAPI RpcBindingFree( RPC_BINDING_HANDLE* Binding )
|
|||
{
|
||||
RPC_STATUS status;
|
||||
TRACE("(%p) = %p\n", Binding, *Binding);
|
||||
status = RPCRT4_ReleaseBinding(*Binding);
|
||||
if (status == RPC_S_OK) *Binding = 0;
|
||||
if (*Binding)
|
||||
status = RPCRT4_ReleaseBinding(*Binding);
|
||||
else
|
||||
status = RPC_S_INVALID_BINDING;
|
||||
if (status == RPC_S_OK) *Binding = NULL;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
|
@ -800,6 +800,17 @@ static void test_UuidCreate(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void test_RpcBindingFree(void)
|
||||
{
|
||||
RPC_BINDING_HANDLE binding = NULL;
|
||||
RPC_STATUS status;
|
||||
|
||||
status = RpcBindingFree(&binding);
|
||||
ok(status == RPC_S_INVALID_BINDING,
|
||||
"RpcBindingFree should have retured RPC_S_INVALID_BINDING instead of %d\n",
|
||||
status);
|
||||
}
|
||||
|
||||
START_TEST( rpc )
|
||||
{
|
||||
UuidConversionAndComparison();
|
||||
|
@ -811,4 +822,5 @@ START_TEST( rpc )
|
|||
test_I_RpcExceptionFilter();
|
||||
test_RpcStringBindingFromBinding();
|
||||
test_UuidCreate();
|
||||
test_RpcBindingFree();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue