]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Fix shutdown order.
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 19 Oct 2016 17:44:38 +0000 (13:44 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 20 Oct 2016 02:28:45 +0000 (22:28 -0400)
When shutting down bgp we were freeing the ecommunity hash
before we unintern'ed everything in it.

This is fallout from:
289d250 bgpd, lib: memory cleanups for valgrind, plus debug changes

Basically we started free'ing data we've never freed before
which caused us to access a hash that had already been freed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_main.c

index 3aa16b2632e9457dd6623b745d1481b15da1a218..50ca7eda4c6d99cf2280cb423d26d58685bfe136 100644 (file)
@@ -253,9 +253,6 @@ bgp_exit (int status)
     bgp_delete (bgp);
   list_free (bm->bgp);
 
-  /* reverse bgp_attr_init */
-  bgp_attr_finish ();
-
   /* reverse bgp_dump_init */
   bgp_dump_finish ();
 
@@ -265,6 +262,9 @@ bgp_exit (int status)
   /* cleanup route maps */
   bgp_route_map_terminate();
 
+  /* reverse bgp_attr_init */
+  bgp_attr_finish ();
+
   /* reverse access_list_init */
   access_list_add_hook (NULL);
   access_list_delete_hook (NULL);