Commit 39a98687 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[IPV6]: Fix memory leak in ah6.c

parent 84b6951b
...@@ -190,7 +190,7 @@ int ah6_output(struct sk_buff *skb) ...@@ -190,7 +190,7 @@ int ah6_output(struct sk_buff *skb)
memcpy(skb->nh.ipv6h, iph, hdr_len); memcpy(skb->nh.ipv6h, iph, hdr_len);
nexthdr = ipv6_clear_mutable_options(skb, &nh_offset, XFRM_POLICY_OUT); nexthdr = ipv6_clear_mutable_options(skb, &nh_offset, XFRM_POLICY_OUT);
if (nexthdr == 0) if (nexthdr == 0)
goto error; goto error_free_iph;
skb->nh.raw[nh_offset] = IPPROTO_AH; skb->nh.raw[nh_offset] = IPPROTO_AH;
skb->nh.ipv6h->payload_len = htons(skb->len - sizeof(struct ipv6hdr)); skb->nh.ipv6h->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
...@@ -239,6 +239,8 @@ int ah6_output(struct sk_buff *skb) ...@@ -239,6 +239,8 @@ int ah6_output(struct sk_buff *skb)
goto error_nolock; goto error_nolock;
} }
return NET_XMIT_BYPASS; return NET_XMIT_BYPASS;
error_free_iph:
kfree(iph);
error: error:
spin_unlock_bh(&x->lock); spin_unlock_bh(&x->lock);
error_nolock: error_nolock:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment