]> git.puffer.fish Git - mirror/frr.git/commitdiff
babeld: be more explicit about route resize result
authorQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 11 Apr 2018 19:19:23 +0000 (15:19 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 13 Apr 2018 21:17:42 +0000 (17:17 -0400)
Resizing the route array can fail. Although the error condition is
already correctly handled, if we're more explicit about the variables we
expect to be initialized then clang-analyze is happier.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
babeld/route.c

index 501dd1f4dfb143e33291c1bd41159d7f444c86c0..bc7590fb39b4478e5f7fe8f24c9b4c515065f16c 100644 (file)
@@ -176,6 +176,7 @@ insert_route(struct babel_route *route)
             resize_route_table(max_route_slots < 1 ? 8 : 2 * max_route_slots);
         if(route_slots >= max_route_slots)
             return NULL;
+        assert(routes);
         route->next = NULL;
         if(n < route_slots)
             memmove(routes + n + 1, routes + n,