Commit 67928c4041606f02725f3c95c4c0404e4532df1b

Authored by Ben Greear
Committed by David S. Miller
1 parent fbe5818690

ipv6-multicast: Fix memory leak in IPv6 multicast.

If reg_vif_xmit cannot find a routing entry, be sure to
free the skb before returning the error.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff

... ... @@ -696,8 +696,10 @@
696 696 int err;
697 697  
698 698 err = ip6mr_fib_lookup(net, &fl6, &mrt);
699   - if (err < 0)
  699 + if (err < 0) {
  700 + kfree_skb(skb);
700 701 return err;
  702 + }
701 703  
702 704 read_lock(&mrt_lock);
703 705 dev->stats.tx_bytes += skb->len;