socket_new()成功后,后续函数不成功返回-1,没有删除socket
This commit is contained in:
parent
00f5094150
commit
63e855d78a
|
@ -917,6 +917,7 @@ int sal_socket(int domain, int type, int protocol)
|
|||
socket = socket_new();
|
||||
if (socket < 0)
|
||||
{
|
||||
socket_delete(socket);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -924,6 +925,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 +958,7 @@ int sal_socket(int domain, int type, int protocol)
|
|||
sock->user_data = (void *) proto_socket;
|
||||
return sock->socket;
|
||||
}
|
||||
|
||||
socket_delete(socket);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue