]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Ensure ptrs are NULL on free
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 16 Dec 2016 01:39:46 +0000 (20:39 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 16 Dec 2016 02:00:03 +0000 (21:00 -0500)
There exists a possibility that when we cleanup
for shutdown that we may attempt to access
them again.

Found via valgrind, stopped showing up in there.

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

index 7b07499533549dc023826499216a8988c6c93f69..ace4961f72b314938158c427afe129107038809e 100644 (file)
@@ -1845,9 +1845,13 @@ route_map_finish (void)
     }
 
   for (i = 1; i < ROUTE_MAP_DEP_MAX; i++)
-    hash_free(route_map_dep_hash[i]);
+    {
+      hash_free(route_map_dep_hash[i]);
+      route_map_dep_hash[i] = NULL;
+    }
 
   hash_free (route_map_master_hash);
+  route_map_master_hash = NULL;
 }
 
 /* Initialization of route map vector. */