Skip to contentSkip to conversation

netfilter: cthelper: fix leak in nfnl_cthelper_del()

PATCH New Pablo Neira Ayuso 1 participant 1 message Mar 17, 2017

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 netfilter: cthelper: fix leak in nfnl_cthelper_del()

Release the helper object and the expect_policy.

---
 net/netfilter/nfnetlink_cthelper.c | 2 ++
 1 file changed, 2 insertions(+)
net/netfilter/nfnetlink_cthelper.c +2 -0
index 3166406d68d3..2defe730b1f4 100644
@@ -609,6 +609,8 @@ static int nfnl_cthelper_del(struct net *net, struct sock *nfnl,
 
 			found = true;
 			nf_conntrack_helper_unregister(cur);
+			kfree(cur->expect_policy);
+			kfree(cur);
 		}
 	}
 	/* Make sure we return success if we flush and there is no helpers */
Signature · 1 line
2.1.4