[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
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
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) if (AllocatedPort == (UINT) -1)
{ {
DbgPrint("ERR: No more ports available.\n"); DbgPrint("ERR: No more ports available.\n");
UnlockObject(Connection);
return STATUS_TOO_MANY_ADDRESSES; return STATUS_TOO_MANY_ADDRESSES;
} }
Connection->AddressFile->Port = AllocatedPort; Connection->AddressFile->Port = AllocatedPort;

View file

@ -386,6 +386,7 @@ NTSTATUS TCPConnect
if (AllocatedPort == (UINT) -1) if (AllocatedPort == (UINT) -1)
{ {
DbgPrint("ERR: No more ports available.\n"); DbgPrint("ERR: No more ports available.\n");
UnlockObject(Connection);
return STATUS_TOO_MANY_ADDRESSES; return STATUS_TOO_MANY_ADDRESSES;
} }
Connection->AddressFile->Port = AllocatedPort; Connection->AddressFile->Port = AllocatedPort;