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 /lib/prefix.c | |
parent | Revert "nhrpd: strncpy -> strlcpy" (diff) | |
parent | tools: add coccinelle spatches (diff) | |
download | frr-d3b05897edff14ceb71c2f5603a9fcdb1ae10c83.tar.xz frr-d3b05897edff14ceb71c2f5603a9fcdb1ae10c83.zip |
Merge pull request #3869 from qlyoung/cocci-fixes
Assorted Coccinelle fixes
Diffstat (limited to 'lib/prefix.c')
-rw-r--r-- | lib/prefix.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/prefix.c b/lib/prefix.c index 80a89cc3c..52bb266f1 100644 --- a/lib/prefix.c +++ b/lib/prefix.c @@ -944,8 +944,7 @@ int str2prefix_eth(const char *str, struct prefix_eth *p) ret = 1; done: - if (cp) - XFREE(MTYPE_TMP, cp); + XFREE(MTYPE_TMP, cp); return ret; } @@ -1503,8 +1502,7 @@ char *prefix_mac2str(const struct ethaddr *mac, char *buf, int size) if (!mac) return NULL; if (!buf) - ptr = (char *)XMALLOC(MTYPE_TMP, - ETHER_ADDR_STRLEN * sizeof(char)); + ptr = XMALLOC(MTYPE_TMP, ETHER_ADDR_STRLEN * sizeof(char)); else { assert(size >= ETHER_ADDR_STRLEN); ptr = buf; @@ -1585,8 +1583,7 @@ char *esi_to_str(const esi_t *esi, char *buf, int size) if (!esi) return NULL; if (!buf) - ptr = (char *)XMALLOC(MTYPE_TMP, - ESI_STR_LEN * sizeof(char)); + ptr = XMALLOC(MTYPE_TMP, ESI_STR_LEN * sizeof(char)); else { assert(size >= ESI_STR_LEN); ptr = buf; |