From: Donatas Abraitis Date: Wed, 11 Mar 2020 16:16:23 +0000 (+0200) Subject: *: Remove tests for some XFREE-family functions X-Git-Tag: base_7.4~253^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=8fa77bc6f4e3af8e5795946cc976fec5b2e0cef5;p=mirror%2Ffrr.git *: Remove tests for some XFREE-family functions XFREE() covers that. Signed-off-by: Donatas Abraitis --- diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c index f73d6e3009..0d2f16ef0c 100644 --- a/bgpd/bgp_aspath.c +++ b/bgpd/bgp_aspath.c @@ -132,8 +132,7 @@ static void assegment_free(struct assegment *seg) if (!seg) return; - if (seg->as) - assegment_data_free(seg->as); + assegment_data_free(seg->as); memset(seg, 0xfe, sizeof(struct assegment)); XFREE(MTYPE_AS_SEG, seg); diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c index c69bc52e47..466fecc581 100644 --- a/bgpd/bgp_debug.c +++ b/bgpd/bgp_debug.c @@ -209,13 +209,8 @@ static void bgp_debug_list_free(struct list *list) if (list) for (ALL_LIST_ELEMENTS(list, node, nnode, filter)) { listnode_delete(list, filter); - - if (filter->p) - prefix_free(&filter->p); - - if (filter->host) - XFREE(MTYPE_BGP_DEBUG_STR, filter->host); - + prefix_free(&filter->p); + XFREE(MTYPE_BGP_DEBUG_STR, filter->host); XFREE(MTYPE_BGP_DEBUG_FILTER, filter); } } diff --git a/lib/if.c b/lib/if.c index 5edb58a2de..dabf66799d 100644 --- a/lib/if.c +++ b/lib/if.c @@ -887,11 +887,8 @@ void connected_free(struct connected **connected) { struct connected *ptr = *connected; - if (ptr->address) - prefix_free(&ptr->address); - - if (ptr->destination) - prefix_free(&ptr->destination); + prefix_free(&ptr->address); + prefix_free(&ptr->destination); XFREE(MTYPE_CONNECTED_LABEL, ptr->label);