diff --git a/opal/util/bipartite_graph.c b/opal/util/bipartite_graph.c index a7a2e88ce4..e53e8e0679 100644 --- a/opal/util/bipartite_graph.c +++ b/opal/util/bipartite_graph.c @@ -914,7 +914,7 @@ int opal_bp_graph_solve_bipartite_assignment(const opal_bp_graph_t *g, goto out; } - *match_edges_out = malloc(*num_match_edges_out * sizeof(*match_edges_out)); + *match_edges_out = malloc(*num_match_edges_out * 2 * sizeof(int)); if (NULL == *match_edges_out) { *num_match_edges_out = 0; OPAL_ERROR_LOG(OPAL_ERR_OUT_OF_RESOURCE);