diff mbox

opensm: fixed sizeof of pointer allocation in osm_ucast_lash()

Message ID 20110307112423.GL5577@calypso.voltaire.com (mailing list archive)
State Accepted
Delegated to: Alex Netes
Headers show

Commit Message

Alex Netes March 7, 2011, 11:24 a.m. UTC
None
diff mbox

Patch

diff --git a/opensm/osm_ucast_lash.c b/opensm/osm_ucast_lash.c
index 0bd1827..739eedd 100644
--- a/opensm/osm_ucast_lash.c
+++ b/opensm/osm_ucast_lash.c
@@ -710,13 +710,13 @@  static int init_lash_structures(lash_t * p_lash)
 
 	/* initialise cdg_vertex_matrix[num_switches][num_switches][num_switches] */
 	p_lash->cdg_vertex_matrix =
-	    (cdg_vertex_t ****) malloc(vl_min * sizeof(cdg_vertex_t ****));
+	    (cdg_vertex_t ****) malloc(vl_min * sizeof(cdg_vertex_t ***));
 	if (p_lash->cdg_vertex_matrix == NULL)
 		goto Exit_Mem_Error;
 	for (i = 0; i < vl_min; i++) {
 		p_lash->cdg_vertex_matrix[i] =
 		    (cdg_vertex_t ***) malloc(num_switches *
-					      sizeof(cdg_vertex_t ***));
+					      sizeof(cdg_vertex_t **));
 
 		if (p_lash->cdg_vertex_matrix[i] == NULL)
 			goto Exit_Mem_Error;