Update sal_socket.c

修复关闭socket时的Bug
This commit is contained in:
HubretXie 2018-09-11 22:26:17 +08:00 committed by GitHub
parent b1bbf434a6
commit 8a9646b613
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -697,9 +697,8 @@ int sal_closesocket(int socket)
if (sock->ops->closesocket((int) sock->user_data) == 0)
{
rt_free(sock);
sock = RT_NULL;
rt_free(sock);
socket_table.sockets[socket] = RT_NULL;
return 0;
}