diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-08-18 14:13:29 -0700 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2009-06-12 17:07:49 +0100 |
commit | 393deb9bd663361e6b110d579a8b1d4c22667068 (patch) | |
tree | e93ebf2f57bf92ff7a9cd045764b3cdbb99a07e5 /ospf6d | |
parent | 3453a7122c1d585ad789ed0f63deb90cc5e89fae (diff) |
[cleanup] Convert XMALLOC/memset to XCALLOC
Simple conversion of XMALLOC/memset to XCALLOC
Diffstat (limited to 'ospf6d')
-rw-r--r-- | ospf6d/ospf6_asbr.c | 3 | ||||
-rw-r--r-- | ospf6d/ospf6_interface.c | 6 | ||||
-rw-r--r-- | ospf6d/ospf6_lsa.c | 6 | ||||
-rw-r--r-- | ospf6d/ospf6_top.c | 3 |
4 files changed, 6 insertions, 12 deletions
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 37b912b4..685b147c 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -504,8 +504,7 @@ ospf6_asbr_redistribute_add (int type, int ifindex, struct prefix *prefix, 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 8d9a7f01..42152084 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -96,11 +96,9 @@ ospf6_interface_create (struct interface *ifp) 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 87df7418..e8290b63 100644 --- a/ospf6d/ospf6_lsa.c +++ b/ospf6d/ospf6_lsa.c @@ -468,8 +468,7 @@ ospf6_lsa_create (struct ospf6_lsa_header *header) /* 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 @@ ospf6_lsa_create_headeronly (struct ospf6_lsa_header *header) /* 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 f59b6f95..d45d1321 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -114,8 +114,7 @@ ospf6_create (void) { 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); |