[IP] Unlock Connection when TCPAllocatePort() fails. CORE-18371

Addendum to 874d317 (0.4.15-dev-5707, #5074).
This commit is contained in:
Serge Gautherie
2023-07-24 22:38:27 +02:00
committed by Thomas Faber
parent 539c316589
commit 2010a5b8d9
2 changed files with 2 additions and 0 deletions

View File

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

View File

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