Merge pull request #1473 from Bluebear233/patch-1

[DFS] Update net_sockets.c
This commit is contained in:
Bernard Xiong 2018-05-31 13:33:42 +08:00 committed by GitHub
commit 661338d279
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -320,6 +320,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);