diff options
Diffstat (limited to 'bgpd/bgp_zebra.c')
-rw-r--r-- | bgpd/bgp_zebra.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index f833ab89d..5f0b20e02 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1586,8 +1586,7 @@ struct bgp_redist *bgp_redist_add(struct bgp *bgp, afi_t afi, uint8_t type, bgp->redist[afi][type] = list_new(); red_list = bgp->redist[afi][type]; - red = (struct bgp_redist *)XCALLOC(MTYPE_BGP_REDIST, - sizeof(struct bgp_redist)); + red = XCALLOC(MTYPE_BGP_REDIST, sizeof(struct bgp_redist)); red->instance = instance; listnode_add(red_list, red); @@ -1694,8 +1693,7 @@ int bgp_redistribute_rmap_set(struct bgp_redist *red, const char *name, if (red->rmap.name && (strcmp(red->rmap.name, name) == 0)) return 0; - if (red->rmap.name) - XFREE(MTYPE_ROUTE_MAP_NAME, red->rmap.name); + XFREE(MTYPE_ROUTE_MAP_NAME, red->rmap.name); /* Decrement the count for existing routemap and * increment the count for new route map. */ @@ -1808,8 +1806,7 @@ int bgp_redistribute_unset(struct bgp *bgp, afi_t afi, int type, bgp_redistribute_unreg(bgp, afi, type, instance); /* Unset route-map. */ - if (red->rmap.name) - XFREE(MTYPE_ROUTE_MAP_NAME, red->rmap.name); + XFREE(MTYPE_ROUTE_MAP_NAME, red->rmap.name); route_map_counter_decrement(red->rmap.map); red->rmap.name = NULL; red->rmap.map = NULL; |