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:
parent
337cc6b60e
commit
f949ae9b31
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user