rpcrt4: Free the resource allocated by InitializeSecurityContext when the connection is closed.

This commit is contained in:
Rob Shearman 2006-12-17 23:45:22 +00:00 committed by Alexandre Julliard
parent 4babec1928
commit 48344f505b
1 changed files with 5 additions and 0 deletions

View File

@ -1280,6 +1280,11 @@ RPC_STATUS RPCRT4_OpenClientConnection(RpcConnection* Connection)
RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection) RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection)
{ {
TRACE("(Connection == ^%p)\n", Connection); TRACE("(Connection == ^%p)\n", Connection);
if (SecIsValidHandle(&Connection->ctx))
{
DeleteSecurityContext(&Connection->ctx);
SecInvalidateHandle(&Connection->ctx);
}
rpcrt4_conn_close(Connection); rpcrt4_conn_close(Connection);
return RPC_S_OK; return RPC_S_OK;
} }