Browse Source

[NETFILTER]: ctnetlink: fix reference count leak

When NFA_NEST exceeds the skb size the protocol reference is leaked.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy 18 years ago
parent
commit
c537b75a3b
2 changed files with 2 additions and 0 deletions
  1. 1 0
      net/ipv4/netfilter/ip_conntrack_netlink.c
  2. 1 0
      net/netfilter/nf_conntrack_netlink.c

+ 1 - 0
net/ipv4/netfilter/ip_conntrack_netlink.c

@@ -153,6 +153,7 @@ ctnetlink_dump_protoinfo(struct sk_buff *skb, const struct ip_conntrack *ct)
 	return ret;
 
 nfattr_failure:
+	ip_conntrack_proto_put(proto);
 	return -1;
 }
 

+ 1 - 0
net/netfilter/nf_conntrack_netlink.c

@@ -161,6 +161,7 @@ ctnetlink_dump_protoinfo(struct sk_buff *skb, const struct nf_conn *ct)
 	return ret;
 
 nfattr_failure:
+	nf_ct_proto_put(proto);
 	return -1;
 }