From e9578ada2f9807d2cf2bbb076396d74baaaa4a11 Mon Sep 17 00:00:00 2001 From: tuexen Date: Mon, 11 Mar 2013 17:43:55 +0000 Subject: Return an error if sctp_peeloff() fails because a socket can't be allocated. MFC after: 3 days --- sys/kern/uipc_syscalls.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/kern/uipc_syscalls.c') diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 894cffc..a262306 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -2386,8 +2386,10 @@ sys_sctp_peeloff(td, uap) CURVNET_SET(head->so_vnet); so = sonewconn(head, SS_ISCONNECTED); - if (so == NULL) + if (so == NULL) { + error = ENOMEM; goto noconnection; + } /* * Before changing the flags on the socket, we have to bump the * reference count. Otherwise, if the protocol calls sofree(), -- cgit v1.1