提交 63e855d7 编写于 作者: K Keyun-Johan

socket_new()成功后,后续函数不成功返回-1,没有删除socket

上级 00f50941
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册