diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2020-09-24 07:56:13 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2020-09-24 07:56:13 -0400 |
| commit | f12296baacce01d8ba851bd541b51aa16ca7fdd9 (patch) | |
| tree | b4ef794a5a39a57c17dc17b973f691b7809577dc | |
| parent | 7895c3bc4f6c73e44ba77eeca1375ee73cb467a3 (diff) | |
isisd: Prevent usage after free
Store the vrf_id so that when we free the area we can
do further cleanup work.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| -rw-r--r-- | isisd/isis_nb_config.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/isisd/isis_nb_config.c b/isisd/isis_nb_config.c index 0988fe8578..6edbc2956a 100644 --- a/isisd/isis_nb_config.c +++ b/isisd/isis_nb_config.c @@ -80,14 +80,18 @@ int isis_instance_create(struct nb_cb_create_args *args) int isis_instance_destroy(struct nb_cb_destroy_args *args) { struct isis_area *area; + vrf_id_t vrf_id; if (args->event != NB_EV_APPLY) return NB_OK; area = nb_running_unset_entry(args->dnode); + + vrf_id = area->isis->vrf_id; + isis_area_destroy(area); /* remove ldp-sync config */ - if (area->isis->vrf_id == VRF_DEFAULT) + if (vrf_id == VRF_DEFAULT) isis_ldp_sync_gbl_exit(true); return NB_OK; |
