From owner-svn-src-all@FreeBSD.ORG Sun Jun 6 02:32:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87AE21065672; Sun, 6 Jun 2010 02:32:20 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 765678FC0A; Sun, 6 Jun 2010 02:32:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o562WKvI009966; Sun, 6 Jun 2010 02:32:20 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o562WKHs009964; Sun, 6 Jun 2010 02:32:20 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006060232.o562WKHs009964@svn.freebsd.org> From: Randall Stewart Date: Sun, 6 Jun 2010 02:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208863 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2010 02:32:20 -0000 Author: rrs Date: Sun Jun 6 02:32:20 2010 New Revision: 208863 URL: http://svn.freebsd.org/changeset/base/208863 Log: Bruce's fix for some return's in error legs. MFC after: 1 week Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Jun 5 23:29:24 2010 (r208862) +++ head/sys/netinet/sctp_usrreq.c Sun Jun 6 02:32:20 2010 (r208863) @@ -4678,6 +4678,8 @@ sctp_accept(struct socket *so, struct so struct sockaddr_in *sin; SCTP_MALLOC_SONAME(sin, struct sockaddr_in *, sizeof *sin); + if (sin == NULL) + return (ENOMEM); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); sin->sin_port = ((struct sockaddr_in *)&store)->sin_port; @@ -4691,6 +4693,8 @@ sctp_accept(struct socket *so, struct so struct sockaddr_in6 *sin6; SCTP_MALLOC_SONAME(sin6, struct sockaddr_in6 *, sizeof *sin6); + if (sin6 == NULL) + return (ENOMEM); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); sin6->sin6_port = ((struct sockaddr_in6 *)&store)->sin6_port; @@ -4756,6 +4760,8 @@ sctp_ingetaddr(struct socket *so, struct * Do the malloc first in case it blocks. */ SCTP_MALLOC_SONAME(sin, struct sockaddr_in *, sizeof *sin); + if (sin == NULL) + return (ENOMEM); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); inp = (struct sctp_inpcb *)so->so_pcb; @@ -4858,6 +4864,8 @@ sctp_peeraddr(struct socket *so, struct return (ENOTCONN); } SCTP_MALLOC_SONAME(sin, struct sockaddr_in *, sizeof *sin); + if (sin == NULL) + return (ENOMEM); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin);