summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMichal Ruzicka <michal.ruzicka@comstar.cz>2006-08-15 11:20:17 +0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-08-18 03:29:49 +0400
commitbb699cbca0096aa3f5f750264ec0af080732375a (patch)
tree4340b45f9750f7855abe937ff9c5c1427166e48a /net
parent640c41c77a96dbbfb74d40ae86ab75b759afb911 (diff)
downloadlinux-bb699cbca0096aa3f5f750264ec0af080732375a.tar.xz
[IPV4]: Possible leak of multicast source filter sctructure
There is a leak of a socket's multicast source filter list structure on closing a socket with a multicast source filter set on an interface that does not exist any more. Signed-off-by: Michal Ruzicka <michal.ruzicka@comstar.cz> Acked-by: David L Stevens <dlstevens@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/igmp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 9f4b752f5a33..e981369ebe13 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -2199,13 +2199,13 @@ void ip_mc_drop_socket(struct sock *sk)
struct in_device *in_dev;
inet->mc_list = iml->next;
- if ((in_dev = inetdev_by_index(iml->multi.imr_ifindex)) != NULL) {
- (void) ip_mc_leave_src(sk, iml, in_dev);
+ in_dev = inetdev_by_index(iml->multi.imr_ifindex);
+ (void) ip_mc_leave_src(sk, iml, in_dev);
+ if (in_dev != NULL) {
ip_mc_dec_group(in_dev, iml->multi.imr_multiaddr.s_addr);
in_dev_put(in_dev);
}
sock_kfree_s(sk, iml, sizeof(*iml));
-
}
rtnl_unlock();
}