Drop Giant in recvit before returning an error to the caller to avoid

leaking the Giant on the syscall exit.
This commit is contained in:
Alexander Kabaev 2003-08-11 19:37:11 +00:00
parent 507c0355a3
commit 660ebf0ef2

View File

@ -942,13 +942,16 @@ recvit(td, s, mp, namelenp)
#endif
mtx_lock(&Giant);
if ((error = fgetsock(td, s, &so, NULL)) != 0)
if ((error = fgetsock(td, s, &so, NULL)) != 0) {
mtx_unlock(&Giant);
return (error);
}
#ifdef MAC
error = mac_check_socket_receive(td->td_ucred, so);
if (error) {
fputsock(so);
mtx_unlock(&Giant);
return (error);
}
#endif