Date: Sun, 6 Jun 2010 02:32:20 +0000 (UTC) From: Randall Stewart <rrs@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r208863 - head/sys/netinet Message-ID: <201006060232.o562WKHs009964@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006060232.o562WKHs009964>