summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-02-25 20:41:01 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-02-25 23:00:46 +0000
commitaa406bbcc8d577e86dec79afc317d71d32453c19 (patch)
tree656736f85b3eb553282c0ecbdb5e4b88a1995823
parent9f5dc3192ed5325b39bdb0580700652b06440606 (diff)
*: replace XMALLOC + memset with XCALLOC
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
-rw-r--r--babeld/babel_interface.c5
-rw-r--r--ospf6d/ospf6_neighbor.c4
2 files changed, 2 insertions, 7 deletions
diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 973c4618f8..0ff89abc49 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -1414,10 +1414,7 @@ static babel_interface_nfo *
babel_interface_allocate (void)
{
babel_interface_nfo *babel_ifp;
- babel_ifp = XMALLOC(MTYPE_BABEL_IF, sizeof(babel_interface_nfo));
-
- /* Here are set the default values for an interface. */
- memset(babel_ifp, 0, sizeof(babel_interface_nfo));
+ babel_ifp = XCALLOC(MTYPE_BABEL_IF, sizeof(babel_interface_nfo));
/* All flags are unset */
babel_ifp->bucket_time = babel_now.tv_sec;
babel_ifp->bucket = BUCKET_TOKENS_MAX;
diff --git a/ospf6d/ospf6_neighbor.c b/ospf6d/ospf6_neighbor.c
index 8a9c2626b0..46dc621ae7 100644
--- a/ospf6d/ospf6_neighbor.c
+++ b/ospf6d/ospf6_neighbor.c
@@ -86,9 +86,7 @@ struct ospf6_neighbor *ospf6_neighbor_create(uint32_t router_id,
struct ospf6_neighbor *on;
char buf[16];
- on = XMALLOC(MTYPE_OSPF6_NEIGHBOR, sizeof(struct ospf6_neighbor));
-
- memset(on, 0, sizeof(struct ospf6_neighbor));
+ on = XCALLOC(MTYPE_OSPF6_NEIGHBOR, sizeof(struct ospf6_neighbor));
inet_ntop(AF_INET, &router_id, buf, sizeof(buf));
snprintf(on->name, sizeof(on->name), "%s%%%s", buf,
oi->interface->name);