Cygwin: accept4: Fix resource leak
The new implementation neglected to release the file descriptor in case of error. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
984c8beeff
commit
00e8707830
|
@ -895,6 +895,8 @@ fhandler_socket_inet::accept4 (struct sockaddr *peer, int *len, int flags)
|
||||||
*len = llen;
|
*len = llen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
fd.release ();
|
||||||
}
|
}
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
::closesocket (res);
|
::closesocket (res);
|
||||||
|
|
|
@ -1012,6 +1012,8 @@ fhandler_socket_local::accept4 (struct sockaddr *peer, int *len, int flags)
|
||||||
*len = (int) sizeof (un.sun_family);
|
*len = (int) sizeof (un.sun_family);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
fd.release ();
|
||||||
}
|
}
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
::closesocket (res);
|
::closesocket (res);
|
||||||
|
|
Loading…
Reference in New Issue