diff options
Diffstat (limited to 'bgpd/bgp_community.c')
| -rw-r--r-- | bgpd/bgp_community.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/bgpd/bgp_community.c b/bgpd/bgp_community.c index 2e28c30950..67cd2be214 100644 --- a/bgpd/bgp_community.c +++ b/bgpd/bgp_community.c @@ -34,17 +34,14 @@ static struct hash *comhash; /* Allocate a new communities value. */ static struct community *community_new(void) { - return (struct community *)XCALLOC(MTYPE_COMMUNITY, - sizeof(struct community)); + return XCALLOC(MTYPE_COMMUNITY, sizeof(struct community)); } /* Free communities value. */ void community_free(struct community **com) { - if ((*com)->val) - XFREE(MTYPE_COMMUNITY_VAL, (*com)->val); - if ((*com)->str) - XFREE(MTYPE_COMMUNITY_STR, (*com)->str); + XFREE(MTYPE_COMMUNITY_VAL, (*com)->val); + XFREE(MTYPE_COMMUNITY_STR, (*com)->str); if ((*com)->json) { json_object_free((*com)->json); |
