⬢ DragonFlyBSD Kernel Audit
DF-3534 / fix.diff
← back to finding ↓ download raw
--- a/sys/netgraph7/tty/ng_tty.c
+++ b/sys/netgraph7/tty/ng_tty.c
@@ -565,6 +565,8 @@ ngt_shutdown(node_p node)
 	/* Free resources */
 	IF_DRAIN(&sc->outq);
 	m_freem(sc->m);
 	kfree(sc, M_NETGRAPH);
+	NG_NODE_SET_PRIVATE(node, NULL);
+	NG_NODE_UNREF(node);	/* drop the constructor reference */
 	lwkt_reltoken(&tp->t_token);
 	return (0);
 }