fixed bug #46471: lwip_accept() leaks socket descriptors if new netconn was already closed because of peer behavior

This commit is contained in:
goldsimon 2015-11-19 07:33:55 +01:00
parent 9c6708513a
commit 8010d6706e
2 changed files with 5 additions and 0 deletions

View File

@ -296,6 +296,10 @@ HISTORY
++ Bugfixes:
2015-11-19: fix by Kerem Hadimli
* sockets.c: fixed bug #46471: lwip_accept() leaks socket descriptors if new
netconn was already closed because of peer behavior
2015-11-12: fix by Valery Ushakov
* tcp_in.c: fixed bug #46365 tcp_accept_null() should call tcp_abort()

View File

@ -556,6 +556,7 @@ lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
if (err != ERR_OK) {
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d): netconn_peer failed, err=%d\n", s, err));
netconn_delete(newconn);
free_socket(nsock, 1);
sock_set_errno(sock, err_to_errno(err));
return -1;
}