Close the socket if bind() fails (dotnet/corefx#36769)
authorOmair Majid <omajid@redhat.com>
Mon, 15 Apr 2019 20:55:02 +0000 (16:55 -0400)
committerDavid Shulman <david.shulman@microsoft.com>
Mon, 15 Apr 2019 20:55:02 +0000 (13:55 -0700)
commitfa823b68fe3a67b3bc55402f9565574bf52ab244
treef337212abac1c58847443087de2531c8f8126cca
parent6b7520a65792d7d77419555128154bbadbe16440
Close the socket if bind() fails (dotnet/corefx#36769)

When using a socket with bind() and bind fails, close the socket to free
up the resources associated with the socket.

Commit migrated from https://github.com/dotnet/corefx/commit/03ae543d4da4e539b9915a5f38f36a69739fa9d9
src/libraries/Native/Unix/System.Native/pal_networkchange.c