From cdea8b85bb82f57e7dd7411f8f39b1fc33a725e9 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Mon, 17 Nov 2003 19:13:44 +0000 Subject: [PATCH] Fixed two memory leaks. Reviewed by: harti --- sys/netgraph/ng_etf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netgraph/ng_etf.c b/sys/netgraph/ng_etf.c index b452bdd2143..1db84a00043 100644 --- a/sys/netgraph/ng_etf.c +++ b/sys/netgraph/ng_etf.c @@ -322,7 +322,8 @@ ng_etf_rcvmsg(node_p node, item_p item, hook_p lasthook) MALLOC(fil, struct filter *, sizeof(*fil), M_NETGRAPH_ETF, M_NOWAIT | M_ZERO); if (fil == NULL) { - return (ENOMEM); + error = ENOMEM; + break; } fil->match_hook = hook; @@ -472,6 +473,7 @@ ng_etf_disconnect(hook_p hook) LIST_FOREACH(fil, (etfp->hashtable + i), next) { if (fil->match_hook == hook) { LIST_REMOVE(fil, next); + FREE(fil, M_NETGRAPH_ETF); } } }