When pru_attach() fails, call sodealloc() on the socket rather than

using sorele() and the full tear-down path.  Since protocol state
allocation failed, this is not required (and is arguably undesirable).
This matches the behavior of sonewconn() under the same circumstances.
This commit is contained in:
Robert Watson 2006-07-11 21:56:58 +00:00
parent 337cc6b60e
commit f949ae9b31

View File

@ -353,10 +353,7 @@ socreate(dom, aso, type, proto, cred, td)
so->so_count = 1;
error = (*prp->pr_usrreqs->pru_attach)(so, proto, td);
if (error) {
ACCEPT_LOCK();
SOCK_LOCK(so);
so->so_state |= SS_NOFDREF;
sorele(so);
sodealloc(so);
return (error);
}
*aso = so;