]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: free neighbor state before exit to avoid memleaks 11606/head
authorChristian Hopps <chopps@labn.net>
Thu, 14 Jul 2022 16:20:01 +0000 (12:20 -0400)
committerChristian Hopps <chopps@labn.net>
Thu, 14 Jul 2022 16:20:01 +0000 (12:20 -0400)
Signed-off-by: Christian Hopps <chopps@labn.net>
zebra/zebra_neigh.c

index 2fca2a06151ac66f40f82ff0b3b7b39fbb990f2b..09e9a62f68147afab01dd2ec7c089015bffa33c8 100644 (file)
@@ -272,8 +272,13 @@ void zebra_neigh_init(void)
 
 void zebra_neigh_terminate(void)
 {
+       struct zebra_neigh_ent *n, *next;
+
        if (!zrouter.neigh_info)
                return;
 
+       RB_FOREACH_SAFE (n, zebra_neigh_rb_head, &zneigh_info->neigh_rb_tree,
+                        next)
+               zebra_neigh_free(n);
        XFREE(MTYPE_ZNEIGH_INFO, zneigh_info);
 }