mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Check that a pointer is non-NULL before dereferencing it, not after.
Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor)
This commit is contained in:
parent
fbd2e692fa
commit
3f54070bd2
1 changed files with 2 additions and 1 deletions
|
|
@ -265,10 +265,11 @@ static void
|
|||
ng_gif_detach(struct ifnet *ifp)
|
||||
{
|
||||
const node_p node = IFP2NG(ifp);
|
||||
const priv_p priv = NG_NODE_PRIVATE(node);
|
||||
const priv_p priv;
|
||||
|
||||
if (node == NULL) /* no node (why not?), ignore */
|
||||
return;
|
||||
priv = NG_NODE_PRIVATE(node);
|
||||
NG_NODE_REALLY_DIE(node); /* Force real removal of node */
|
||||
/*
|
||||
* We can't assume the ifnet is still around when we run shutdown
|
||||
|
|
|
|||
Loading…
Reference in a new issue