[cleanup] Convert XMALLOC/memset to XCALLOC
Simple conversion of XMALLOC/memset to XCALLOC
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index 37b912b..685b147 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -504,8 +504,7 @@
memcpy (&route->prefix, prefix, sizeof (struct prefix));
info = (struct ospf6_external_info *)
- XMALLOC (MTYPE_OSPF6_EXTERNAL_INFO, sizeof (struct ospf6_external_info));
- memset (info, 0, sizeof (struct ospf6_external_info));
+ XCALLOC (MTYPE_OSPF6_EXTERNAL_INFO, sizeof (struct ospf6_external_info));
route->route_option = info;
info->id = ospf6->external_id++;
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index 8d9a7f0..4215208 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -96,11 +96,9 @@
unsigned int iobuflen;
oi = (struct ospf6_interface *)
- XMALLOC (MTYPE_OSPF6_IF, sizeof (struct ospf6_interface));
+ XCALLOC (MTYPE_OSPF6_IF, sizeof (struct ospf6_interface));
- if (oi)
- memset (oi, 0, sizeof (struct ospf6_interface));
- else
+ if (!oi)
{
zlog_err ("Can't malloc ospf6_interface for ifindex %d", ifp->ifindex);
return (struct ospf6_interface *) NULL;
diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c
index 87df741..e8290b6 100644
--- a/ospf6d/ospf6_lsa.c
+++ b/ospf6d/ospf6_lsa.c
@@ -468,8 +468,7 @@
/* LSA information structure */
/* allocate memory */
lsa = (struct ospf6_lsa *)
- XMALLOC (MTYPE_OSPF6_LSA, sizeof (struct ospf6_lsa));
- memset (lsa, 0, sizeof (struct ospf6_lsa));
+ XCALLOC (MTYPE_OSPF6_LSA, sizeof (struct ospf6_lsa));
lsa->header = (struct ospf6_lsa_header *) new_header;
@@ -498,8 +497,7 @@
/* LSA information structure */
/* allocate memory */
lsa = (struct ospf6_lsa *)
- XMALLOC (MTYPE_OSPF6_LSA, sizeof (struct ospf6_lsa));
- memset (lsa, 0, sizeof (struct ospf6_lsa));
+ XCALLOC (MTYPE_OSPF6_LSA, sizeof (struct ospf6_lsa));
lsa->header = (struct ospf6_lsa_header *) new_header;
SET_FLAG (lsa->flag, OSPF6_LSA_HEADERONLY);
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c
index f59b6f9..d45d132 100644
--- a/ospf6d/ospf6_top.c
+++ b/ospf6d/ospf6_top.c
@@ -114,8 +114,7 @@
{
struct ospf6 *o;
- o = XMALLOC (MTYPE_OSPF6_TOP, sizeof (struct ospf6));
- memset (o, 0, sizeof (struct ospf6));
+ o = XCALLOC (MTYPE_OSPF6_TOP, sizeof (struct ospf6));
/* initialize */
gettimeofday (&o->starttime, (struct timezone *) NULL);