Commit cdc10a8d authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

rpcrt4: Don't crash with a NULL binding handle in RpcBindingFree.

parent b49512ec
......@@ -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();
}
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