shewu / h4ck4th0n

Holy Balls: The Game
8 stars 2 forks source link

client leaks fd on failure to connect to server #50

Closed shewu closed 7 years ago

shewu commented 9 years ago

there is no corresponding close(socketfd) to our creation.

int sockfd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);

in addition to closing, we should set sockfd to -1 afterwards.