]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Fix possible use while uninited
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 13 Jun 2018 11:47:24 +0000 (07:47 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 13 Jun 2018 11:47:24 +0000 (07:47 -0400)
Certain compilers are saying that it is possible
to use some json variables before they are initialized,
which could result in using weird data.  Fix to make
compiler happy even if this is never possible.

Fixes: #2423
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_evpn_vty.c

index c74a1bfb7cf8bcd4398de2b4305eaa73d75dc101..e4e042035d5bfd075d12159da2ead84034193124 100644 (file)
@@ -603,9 +603,9 @@ static void show_vni_routes_hash(struct hash_backet *backet, void *arg)
 static void show_l3vni_entry(struct vty *vty, struct bgp *bgp,
                             json_object *json)
 {
-       json_object *json_vni;
-       json_object *json_import_rtl;
-       json_object *json_export_rtl;
+       json_object *json_vni = NULL;
+       json_object *json_import_rtl = NULL;
+       json_object *json_export_rtl = NULL;
        char buf1[10];
        char buf2[INET6_ADDRSTRLEN];
        char rt_buf[25];