BNetworkAddress: Close socket in ResolveForDestination.

It was closed on all the failure cases but not on the success one.
Found by Coverity.
This commit is contained in:
Augustin Cavalier
2017-11-23 19:40:02 +01:00
parent 75fa008e23
commit 7131246873
@@ -963,6 +963,7 @@ BNetworkAddress::ResolveForDestination(const BNetworkAddress& destination)
memcpy(&fAddress, route->source, sizeof(sockaddr_storage)); memcpy(&fAddress, route->source, sizeof(sockaddr_storage));
SetPort(port); SetPort(port);
close(socket);
return B_OK; return B_OK;
} }