Merge pull request #3534 from Keyun-Johan/mydoc

socket_new() 错误返回时的问题
This commit is contained in:
Bernard Xiong
2020-04-15 16:08:43 +08:00
committed by GitHub
+2 -1
View File
@@ -924,6 +924,7 @@ int sal_socket(int domain, int type, int protocol)
sock = sal_get_socket(socket);
if (sock == RT_NULL)
{
socket_delete(socket);
return -1;
}
@@ -956,7 +957,7 @@ int sal_socket(int domain, int type, int protocol)
sock->user_data = (void *) proto_socket;
return sock->socket;
}
socket_delete(socket);
return -1;
}