Date: Sat, 9 Jun 2012 22:44:25 +0000 (UTC) From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r236826 - stable/9/sys/netinet6 Message-ID: <201206092244.q59MiPdp058305@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bz Date: Sat Jun 9 22:44:24 2012 New Revision: 236826 URL: http://svn.freebsd.org/changeset/base/236826 Log: MFC r236615: Plug two interface address refcount leaks in early error return cases in the ioctl path. Reported by: rpaulo Reviewed by: emax Modified: stable/9/sys/netinet6/in6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Sat Jun 9 22:26:53 2012 (r236825) +++ stable/9/sys/netinet6/in6.c Sat Jun 9 22:44:24 2012 (r236826) @@ -1638,14 +1638,19 @@ in6_lifaddr_ioctl(struct socket *so, u_l hostid = IFA_IN6(ifa); /* prefixlen must be <= 64. */ - if (64 < iflr->prefixlen) + if (64 < iflr->prefixlen) { + if (ifa != NULL) + ifa_free(ifa); return EINVAL; + } prefixlen = iflr->prefixlen; /* hostid part must be zero. */ sin6 = (struct sockaddr_in6 *)&iflr->addr; if (sin6->sin6_addr.s6_addr32[2] != 0 || sin6->sin6_addr.s6_addr32[3] != 0) { + if (ifa != NULL) + ifa_free(ifa); return EINVAL; } } else
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206092244.q59MiPdp058305>