[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20080604235035.GJ20815@postel.suug.ch>
Date: Thu, 5 Jun 2008 01:50:35 +0200
From: Thomas Graf <tgraf@...g.ch>
To: YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>
Cc: netdev@...r.kernel.org
Subject: [PATCH] ipv6 addrconf: Fix memory leak when deleting addresses
ip6_del_rt() may fail in which case the dst/route is not released.
Signed-off-by: Thomas graf <tgraf@...g.ch>
Index: net-2.6/net/ipv6/addrconf.c
===================================================================
--- net-2.6.orig/net/ipv6/addrconf.c 2008-06-04 22:59:11.000000000 +0200
+++ net-2.6/net/ipv6/addrconf.c 2008-06-04 23:07:05.000000000 +0200
@@ -779,8 +779,8 @@
if (rt && ((rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 0)) {
if (onlink == 0) {
- ip6_del_rt(rt);
- rt = NULL;
+ if (ip6_del_rt(rt) == 0)
+ goto out;
} else if (!(rt->rt6i_flags & RTF_EXPIRES)) {
rt->rt6i_expires = expires;
rt->rt6i_flags |= RTF_EXPIRES;
@@ -788,7 +788,7 @@
}
dst_release(&rt->u.dst);
}
-
+out:
in6_ifa_put(ifp);
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists