From 393deb9bd663361e6b110d579a8b1d4c22667068 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 18 Aug 2008 14:13:29 -0700 Subject: [cleanup] Convert XMALLOC/memset to XCALLOC Simple conversion of XMALLOC/memset to XCALLOC --- ospfd/ospf_lsa.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'ospfd/ospf_lsa.c') diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index f453353d..3c9c73a3 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -304,12 +304,7 @@ ospf_lsa_discard (struct ospf_lsa *lsa) struct lsa_header * ospf_lsa_data_new (size_t size) { - struct lsa_header *new; - - new = (struct lsa_header *) XMALLOC (MTYPE_OSPF_LSA_DATA, size); - memset (new, 0, size); - - return new; + return XCALLOC (MTYPE_OSPF_LSA_DATA, size); } /* Duplicate LSA data. */ @@ -3635,9 +3630,7 @@ ospf_schedule_lsa_flood_area (struct ospf_area *area, struct ospf_lsa *lsa) { struct lsa_action *data; - data = XMALLOC (MTYPE_OSPF_MESSAGE, sizeof (struct lsa_action)); - memset (data, 0, sizeof (struct lsa_action)); - + data = XCALLOC (MTYPE_OSPF_MESSAGE, sizeof (struct lsa_action)); data->action = LSA_ACTION_FLOOD_AREA; data->area = area; data->lsa = ospf_lsa_lock (lsa); /* Message / Flood area */ @@ -3650,9 +3643,7 @@ ospf_schedule_lsa_flush_area (struct ospf_area *area, struct ospf_lsa *lsa) { struct lsa_action *data; - data = XMALLOC (MTYPE_OSPF_MESSAGE, sizeof (struct lsa_action)); - memset (data, 0, sizeof (struct lsa_action)); - + data = XCALLOC (MTYPE_OSPF_MESSAGE, sizeof (struct lsa_action)); data->action = LSA_ACTION_FLUSH_AREA; data->area = area; data->lsa = ospf_lsa_lock (lsa); /* Message / Flush area */ -- cgit v1.2.1