未验证 提交 ec81f44f 编写于 作者: B Bluebear233 提交者: GitHub

Update net_sockets.c

修复创建socket失败仍然返回有效的fd
上级 51db86ca
......@@ -316,6 +316,16 @@ int socket(int domain, int type, int protocol)
rt_list_init(&(lwsock->wait_head));
lwsock->conn->callback = event_callback;
}
else
{
/* release fd */
fd_put(d);
fd_put(d);
rt_set_errno(-ENOMEM);
return -1;
}
/* release the ref-count of fd */
fd_put(d);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册