diff options
| author | David Lamparter <equinox@diac24.net> | 2019-03-06 15:54:44 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-06 15:54:44 +0100 |
| commit | d3b05897edff14ceb71c2f5603a9fcdb1ae10c83 (patch) | |
| tree | 274b088939d9686c289d5de95d70cdb39a01e4b4 /bgpd/bgp_community.c | |
| parent | b19abe1131daa38d1d0e31c4793925bb89f11c07 (diff) | |
| parent | 25af5f0d79f9e5595b1ba3bb04a0aff876471029 (diff) | |
Merge pull request #3869 from qlyoung/cocci-fixes
Assorted Coccinelle fixes
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); |
