From c517178d2c396b3c5860057c3a6c2595eb70c2e0 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 8 Aug 2018 12:32:21 +0200 Subject: [PATCH] pimd: fix bogus uninitialized warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit pimd/pim_nht.c: In function ‘pim_ecmp_nexthop_search’: pimd/pim_nht.c:523:17: error: ‘nbr’ may be used uninitialized in this function [-Werror=maybe-uninitialized] nexthop->nbr = nbr; (on gcc 5.4.0; this is the only warning with that version.) Signed-off-by: David Lamparter --- pimd/pim_nht.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pimd/pim_nht.c b/pimd/pim_nht.c index 74dfed0455..0a64c8db3d 100644 --- a/pimd/pim_nht.c +++ b/pimd/pim_nht.c @@ -352,7 +352,7 @@ int pim_ecmp_nexthop_search(struct pim_instance *pim, struct pim_nexthop *nexthop, struct prefix *src, struct prefix *grp, int neighbor_needed) { - struct pim_neighbor *nbrs[MULTIPATH_NUM], *nbr; + struct pim_neighbor *nbrs[MULTIPATH_NUM], *nbr = NULL; struct interface *ifps[MULTIPATH_NUM]; struct nexthop *nh_node = NULL; ifindex_t first_ifindex; -- 2.39.5