diff --git a/sys/netgraph7/netgraph/ng_base.c b/sys/netgraph7/netgraph/ng_base.c index 739d7d5..15e83ae 100644 --- a/sys/netgraph7/netgraph/ng_base.c +++ b/sys/netgraph7/netgraph/ng_base.c @@ -1977,6 +1977,7 @@ done: if (refcount_release(&item->apply->refs)) { (*item->apply->apply)(item->apply->context, item->apply->error); + item->apply = NULL; } } @@ -2139,8 +2140,10 @@ ng_apply_item(node_p node, item_p item) if (apply != NULL) { if (depth == 1 && error != 0) apply->error = error; - if (refcount_release(&apply->refs)) + if (refcount_release(&apply->refs)) { (*apply->apply)(apply->context, apply->error); + item->apply = NULL; + } } return (error);