Commit 38ea9def authored by Yajun Deng's avatar Yajun Deng Committed by Pablo Neira Ayuso

netfilter: nf_conntrack_bridge: Fix memory leak when error

It should be added kfree_skb_list() when err is not equal to zero
in nf_br_ip_fragment().

v2: keep this aligned with IPv6.
v3: modify iter.frag_list to iter.frag.

Fixes: 3c171f49 ("netfilter: bridge: add connection tracking system")
Signed-off-by: default avatarYajun Deng <yajun.deng@linux.dev>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 5f7b51bf
......@@ -88,6 +88,12 @@ static int nf_br_ip_fragment(struct net *net, struct sock *sk,
skb = ip_fraglist_next(&iter);
}
if (!err)
return 0;
kfree_skb_list(iter.frag);
return err;
}
slow_path:
......
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