Skip to content

Commit

Permalink
bridge: netfilter: fix a memory leak
Browse files Browse the repository at this point in the history
nf_bridge_alloc() always reset the skb->nf_bridge, so we should always
put the old one.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: Bart De Schuymer <bdschuym@pandora.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Changli Gao authored and David S. Miller committed Aug 24, 2010
1 parent cca77b7 commit 4c3a76a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/bridge/br_netfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ static inline struct nf_bridge_info *nf_bridge_unshare(struct sk_buff *skb)
if (tmp) {
memcpy(tmp, nf_bridge, sizeof(struct nf_bridge_info));
atomic_set(&tmp->use, 1);
nf_bridge_put(nf_bridge);
}
nf_bridge_put(nf_bridge);
nf_bridge = tmp;
}
return nf_bridge;
Expand Down

0 comments on commit 4c3a76a

Please sign in to comment.