diff --git a/drivers/network/tcpip/ip/transport/tcp/accept.c b/drivers/network/tcpip/ip/transport/tcp/accept.c index 4d12c527fae..cfab933003d 100644 --- a/drivers/network/tcpip/ip/transport/tcp/accept.c +++ b/drivers/network/tcpip/ip/transport/tcp/accept.c @@ -82,6 +82,7 @@ NTSTATUS TCPListen(PCONNECTION_ENDPOINT Connection, UINT Backlog) if (AllocatedPort == (UINT) -1) { DbgPrint("ERR: No more ports available.\n"); + UnlockObject(Connection); return STATUS_TOO_MANY_ADDRESSES; } Connection->AddressFile->Port = AllocatedPort; diff --git a/drivers/network/tcpip/ip/transport/tcp/tcp.c b/drivers/network/tcpip/ip/transport/tcp/tcp.c index cd28ffaf71a..3d65e9a46b9 100644 --- a/drivers/network/tcpip/ip/transport/tcp/tcp.c +++ b/drivers/network/tcpip/ip/transport/tcp/tcp.c @@ -386,6 +386,7 @@ NTSTATUS TCPConnect if (AllocatedPort == (UINT) -1) { DbgPrint("ERR: No more ports available.\n"); + UnlockObject(Connection); return STATUS_TOO_MANY_ADDRESSES; } Connection->AddressFile->Port = AllocatedPort;