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
commit d3ce0b27ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

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;
}