svn commit: r231324 - stable/9/sys/netinet6

Bjoern A. Zeeb bz at FreeBSD.org
Fri Feb 10 00:24:39 UTC 2012


Author: bz
Date: Fri Feb 10 00:24:39 2012
New Revision: 231324
URL: http://svn.freebsd.org/changeset/base/231324

Log:
  MFC r230506:
  
   Plug a possible ifa_ref leak in case of premature return from in6_purgeaddr().
  
   Reviewed by:	rwatson

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	Fri Feb 10 00:10:13 2012	(r231323)
+++ stable/9/sys/netinet6/in6.c	Fri Feb 10 00:24:39 2012	(r231324)
@@ -1448,6 +1448,8 @@ in6_purgeaddr(struct ifaddr *ifa)
 	}
 
 cleanup:
+	if (ifa0 != NULL)
+		ifa_free(ifa0);
 
 	plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */
 	if ((ia->ia_flags & IFA_ROUTE) && plen == 128) {
@@ -1472,8 +1474,6 @@ cleanup:
 			return;
 		ia->ia_flags &= ~IFA_ROUTE;
 	}
-	if (ifa0 != NULL)
-		ifa_free(ifa0);
 
 	in6_unlink_ifa(ia, ifp);
 }


More information about the svn-src-stable-9 mailing list