Re: Finding memory leak

From: Jörn Engel
Date: Sat Oct 18 2003 - 12:47:59 EST


On Sat, 18 October 2003 19:23:53 +0200, Jörn Engel wrote:
> >
> > - Could someone please check igmpv3_newpack() and assure me that there
> > is no leak.
>
> There was a leak, found by the stanford checker team. I've provided a
> broken fix, DaveM wanted to write a decent one. Not sure if it has
> already found it's way into the official kernel.

If DaveM hasn't fixed it yet, you can also try this patch. Since I'm
pretty unaware of the networking code, this may be broken again, but
it also can't make things much worse for you.

Jörn

--
Write programs that do one thing and do it well. Write programs to work
together. Write programs to handle text streams, because that is a
universal interface.
-- Doug MacIlroy

--- linux-2.6.0-test5/net/ipv4/igmp.c~igmp_memleak 2003-09-17 15:21:02.000000000 +0200
+++ linux-2.6.0-test5/net/ipv4/igmp.c 2003-10-18 19:46:17.000000000 +0200
@@ -70,6 +70,8 @@
* Alexey Kuznetsov: Accordance to igmp-v2-06 draft.
* David L Stevens: IGMPv3 support, with help from
* Vinay Kulkarni
+ * Jörn Engel: Fix memleak in igmpv3_newpack, reported
+ * by David Yu Chen (stanford checker)
*/


@@ -280,8 +282,10 @@
.nl_u = { .ip4_u = {
.daddr = IGMPV3_ALL_MCR } },
.proto = IPPROTO_IGMP };
- if (ip_route_output_key(&rt, &fl))
+ if (ip_route_output_key(&rt, &fl)) {
+ kfree_skb(skb);
return 0;
+ }
}
if (rt->rt_src == 0) {
ip_rt_put(rt);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/