Gracefully close the socket

This commit is contained in:
Joseph C. Lehner 2016-02-05 14:16:49 +02:00
parent 74ab06f9e8
commit ea850215ab

5
tftp.c
View file

@ -314,7 +314,12 @@ cleanup:
}
if (sock >= 0) {
shutdown(sock, SHUT_RDWR);
#ifndef NMRPFLASH_WINDOWS
close(sock);
#else
closesocket(sock);
#endif
}
return err;