summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
diff options
context:
space:
mode:
authornetchild <netchild@FreeBSD.org>2006-09-30 12:37:43 +0000
committernetchild <netchild@FreeBSD.org>2006-09-30 12:37:43 +0000
commit50524ad5bec058911394944145eec9a848a56545 (patch)
tree5dd2d33f6a501caa23bc4991b84a3e29f25ffe8f /sys/netgraph
parentce834377c6b1c88351dbac94245fad56f0fe0671 (diff)
downloadFreeBSD-src-50524ad5bec058911394944145eec9a848a56545.zip
FreeBSD-src-50524ad5bec058911394944145eec9a848a56545.tar.gz
Don't use data after free.
Found by: Coverity Prevent CID: 536 Submitted by: harti (via vs)
Diffstat (limited to 'sys/netgraph')
-rw-r--r--sys/netgraph/atm/ccatm/ng_ccatm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netgraph/atm/ccatm/ng_ccatm.c b/sys/netgraph/atm/ccatm/ng_ccatm.c
index f2e2b87..7030369 100644
--- a/sys/netgraph/atm/ccatm/ng_ccatm.c
+++ b/sys/netgraph/atm/ccatm/ng_ccatm.c
@@ -879,6 +879,7 @@ ng_ccatm_disconnect(hook_p hook)
node_p node = NG_HOOK_NODE(hook);
struct ccnode *priv = NG_NODE_PRIVATE(node);
struct cchook *hd = NG_HOOK_PRIVATE(hook);
+ struct ccdata *cc;
if (hook == priv->dump) {
priv->dump = NULL;
@@ -893,12 +894,14 @@ ng_ccatm_disconnect(hook_p hook)
else
cc_user_destroy(hd->inst);
+ cc = hd->node->data;
+
free(hd, M_NG_CCATM);
NG_HOOK_SET_PRIVATE(hook, NULL);
priv->hook_cnt--;
- cc_work(hd->node->data);
+ cc_work(cc);
}
/*
OpenPOWER on IntegriCloud