From: Quentin Young Date: Mon, 25 Feb 2019 20:41:01 +0000 (+0000) Subject: *: replace XMALLOC + memset with XCALLOC X-Git-Tag: 7.1_pulled~195^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=aa406bbcc8d577e86dec79afc317d71d32453c19;p=matthieu%2Ffrr.git *: replace XMALLOC + memset with XCALLOC Signed-off-by: Quentin Young --- 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);