diff options
author | Zhen Lei <thunder.leizhen@huawei.com> | 2018-06-27 11:49:28 +0800 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2018-06-27 17:32:11 +0200 |
commit | 7284fdf39a912322ce97de2d30def3c6068a418c (patch) | |
tree | a92da568ecb04878d8e0984b74816f982a316fa6 /net/ipv6/esp6.c | |
parent | 86126b77dcd551ce223e7293bb55854e3df05646 (diff) | |
download | linux-7284fdf39a912322ce97de2d30def3c6068a418c.tar.gz linux-7284fdf39a912322ce97de2d30def3c6068a418c.tar.bz2 linux-7284fdf39a912322ce97de2d30def3c6068a418c.zip |
esp6: fix memleak on error path in esp6_input
This ought to be an omission in e6194923237 ("esp: Fix memleaks on error
paths."). The memleak on error path in esp6_input is similar to esp_input
of esp4.
Fixes: e6194923237 ("esp: Fix memleaks on error paths.")
Fixes: 3f29770723f ("ipsec: check return value of skb_to_sgvec always")
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/ipv6/esp6.c')
-rw-r--r-- | net/ipv6/esp6.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index 97513f35bcc5..88a7579c23bd 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c @@ -669,8 +669,10 @@ skip_cow: sg_init_table(sg, nfrags); ret = skb_to_sgvec(skb, sg, 0, skb->len); - if (unlikely(ret < 0)) + if (unlikely(ret < 0)) { + kfree(tmp); goto out; + } skb->ip_summed = CHECKSUM_NONE; |