Skip to content

Commit 7284fdf

Browse files
Zhen Leiklassert
authored andcommitted
esp6: fix memleak on error path in esp6_input
This ought to be an omission in e619492 ("esp: Fix memleaks on error paths."). The memleak on error path in esp6_input is similar to esp_input of esp4. Fixes: e619492 ("esp: Fix memleaks on error paths.") Fixes: 3f29770 ("ipsec: check return value of skb_to_sgvec always") Signed-off-by: Zhen Lei <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent 86126b7 commit 7284fdf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/ipv6/esp6.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,8 +669,10 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb)
669669

670670
sg_init_table(sg, nfrags);
671671
ret = skb_to_sgvec(skb, sg, 0, skb->len);
672-
if (unlikely(ret < 0))
672+
if (unlikely(ret < 0)) {
673+
kfree(tmp);
673674
goto out;
675+
}
674676

675677
skb->ip_summed = CHECKSUM_NONE;
676678

0 commit comments

Comments
 (0)