Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jan 2012 13:57:30 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r230506 - head/sys/netinet6
Message-ID:  <201201241357.q0ODvUfa078114@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Tue Jan 24 13:57:30 2012
New Revision: 230506
URL: http://svn.freebsd.org/changeset/base/230506

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

Modified:
  head/sys/netinet6/in6.c

Modified: head/sys/netinet6/in6.c
==============================================================================
--- head/sys/netinet6/in6.c	Tue Jan 24 13:23:52 2012	(r230505)
+++ head/sys/netinet6/in6.c	Tue Jan 24 13:57:30 2012	(r230506)
@@ -1477,6 +1477,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) {
@@ -1501,8 +1503,6 @@ cleanup:
 			return;
 		ia->ia_flags &= ~IFA_ROUTE;
 	}
-	if (ifa0 != NULL)
-		ifa_free(ifa0);
 
 	in6_unlink_ifa(ia, ifp);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201241357.q0ODvUfa078114>