]> git.proxmox.com Git - mirror_frr.git/commitdiff
*: replace XMALLOC + memset with XCALLOC
authorQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 25 Feb 2019 20:41:01 +0000 (20:41 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 25 Feb 2019 23:00:46 +0000 (23:00 +0000)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
babeld/babel_interface.c
ospf6d/ospf6_neighbor.c

index 973c4618f836e8b14d126a16a25ad7c84b28fd26..0ff89abc495ab38fc1867c6619e1beb393d836d0 100644 (file)
@@ -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;
index 8a9c2626b0bb71d7f7232f886b20c60ad88ee43c..46dc621ae7d169bcd02b3897b1a47fa002c4f8ee 100644 (file)
@@ -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);