From 832e7323571246bc7598d0c91c424ede93b35ab0 Mon Sep 17 00:00:00 2001 From: ru Date: Mon, 17 Nov 2003 19:13:44 +0000 Subject: Fixed two memory leaks. Reviewed by: harti --- sys/netgraph/ng_etf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/netgraph') diff --git a/sys/netgraph/ng_etf.c b/sys/netgraph/ng_etf.c index b452bdd..1db84a0 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); } } } -- cgit v1.1