From afa98f92e836e6e5f001992f32fd7d1d8186a2bc Mon Sep 17 00:00:00 2001 From: Sharon Melamed Date: Wed, 26 Mar 2008 14:45:45 +0000 Subject: [PATCH] Changed the for loop to a while loop so I could release the edge without conflicting with get next. This commit was SVN r17979. --- opal/class/opal_graph.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/opal/class/opal_graph.c b/opal/class/opal_graph.c index 0c3ab34221..f3ba427ffc 100644 --- a/opal/class/opal_graph.c +++ b/opal/class/opal_graph.c @@ -209,10 +209,11 @@ static void delete_all_edges_conceded_to_vertex(opal_graph_t *graph, opal_graph_ /** * for all the edges in the adjacency list */ - for (edge_item = opal_list_get_first(aj_list->edges); - edge_item != opal_list_get_end(aj_list->edges); - edge_item = opal_list_get_next(edge_item)) { + edge_item = opal_list_get_first(aj_list->edges); + while (edge_item != opal_list_get_end(aj_list->edges)) { edge = (opal_graph_edge_t *)edge_item; + edge_item = opal_list_get_next(edge_item); + /** * if the edge is ended in the vertex */