ipv6 addrconf: Fix memory leak when deleting addresses
Subsystems (3)
PATCH 1/1 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 <[email protected]>
net/ipv6/addrconf.c +3 -3
@@ -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); }