summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-05-28 16:13:16 +0200
committerDonald Sharp <sharpd@nvidia.com>2023-05-28 16:13:16 +0200
commit46d725f76b4ae045f0930fe310dbbcf8d8280bb4 (patch)
tree1a6686e7e7d30c0f392f7bcdd498de9fa7191d52 /lib
parentpimd: When doing json output do not output non-json strings (diff)
downloadfrr-46d725f76b4ae045f0930fe310dbbcf8d8280bb4.tar.xz
frr-46d725f76b4ae045f0930fe310dbbcf8d8280bb4.zip
lib, zebra: Ensure that the ifp->node exists
On removal, ensure that the ifp->node is set to a null pointer so that FRR does not use data after freed. In addition ensure that the ifp->node exists before attempting to free it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/if.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/if.c b/lib/if.c
index 08d891874..6f567861d 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -1028,6 +1028,7 @@ void if_terminate(struct vrf *vrf)
if (ifp->node) {
ifp->node->info = NULL;
route_unlock_node(ifp->node);
+ ifp->node = NULL;
}
if_delete(&ifp);
}