[net][at] Modify AT socket object release judgment

This commit is contained in:
chenyong 2018-08-31 14:45:40 +08:00
parent a3ea0565cf
commit 33a5cf15ee
1 changed files with 6 additions and 2 deletions

View File

@ -404,11 +404,13 @@ int at_closesocket(int socket)
if (at_dev_ops->at_closesocket(socket) != 0)
{
LOG_E("AT socket (%d) closesocket failed!", socket);
free_socket(sock);
return -1;
}
}
return free_socket(sock);
free_socket(sock);
return 0;
}
int at_shutdown(int socket, int how)
@ -431,11 +433,13 @@ int at_shutdown(int socket, int how)
if (at_dev_ops->at_closesocket(socket) != 0)
{
LOG_E("AT socket (%d) shutdown failed!", socket);
free_socket(sock);
return -1;
}
}
return free_socket(sock);
free_socket(sock);
return 0;
}
int at_bind(int socket, const struct sockaddr *name, socklen_t namelen)