]> git.hungrycats.org Git - linux/commitdiff
[IPV6]: Fix memory leak in ah6.c
authorPatrick McHardy <kaber@trash.net>
Sat, 29 May 2004 05:37:22 +0000 (22:37 -0700)
committerDavid S. Miller <davem@nuts.davemloft.net>
Sat, 29 May 2004 05:37:22 +0000 (22:37 -0700)
net/ipv6/ah6.c

index 4f61bffd721dd3363f0a94dd637430c6e37d863f..81c5d9766b7c8f6d58452a03a8a096b4d5e949c2 100644 (file)
@@ -190,7 +190,7 @@ int ah6_output(struct sk_buff *skb)
                memcpy(skb->nh.ipv6h, iph, hdr_len);
                nexthdr = ipv6_clear_mutable_options(skb, &nh_offset, XFRM_POLICY_OUT);
                if (nexthdr == 0)
-                       goto error;
+                       goto error_free_iph;
 
                skb->nh.raw[nh_offset] = IPPROTO_AH;
                skb->nh.ipv6h->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
@@ -239,6 +239,8 @@ int ah6_output(struct sk_buff *skb)
                goto error_nolock;
        }
        return NET_XMIT_BYPASS;
+error_free_iph:
+       kfree(iph);
 error:
        spin_unlock_bh(&x->lock);
 error_nolock: