Skip to content

Commit b638612

Browse files
authored
Merge pull request #3744 from hjelmn/ompi_cov
opal: fix coverity issues
2 parents 52d44af + db97343 commit b638612

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

opal/class/opal_graph.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,15 +257,14 @@ void opal_graph_add_vertex(opal_graph_t *graph, opal_graph_vertex_t *vertex)
257257
int opal_graph_add_edge(opal_graph_t *graph, opal_graph_edge_t *edge)
258258
{
259259
opal_adjacency_list_t *aj_list, *start_aj_list= NULL;
260-
bool start_found = false, end_found = false;
260+
bool end_found = false;
261261

262262

263263
/**
264264
* find the vertices that this edge should connect.
265265
*/
266266
OPAL_LIST_FOREACH(aj_list, graph->adjacency_list, opal_adjacency_list_t) {
267267
if (aj_list->vertex == edge->start) {
268-
start_found = true;
269268
start_aj_list = aj_list;
270269
}
271270
if (aj_list->vertex == edge->end) {
@@ -276,7 +275,7 @@ int opal_graph_add_edge(opal_graph_t *graph, opal_graph_edge_t *edge)
276275
* if one of the vertices either the start or the end is not
277276
* found - return an error.
278277
*/
279-
if (false == start_found && false == end_found) {
278+
if (NULL == start_aj_list || false == end_found) {
280279
return OPAL_ERROR;
281280
}
282281
/* point the edge to the adjacency list of the start vertex (for easy search) */

opal/memoryhooks/memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ opal_mem_hooks_register_release(opal_mem_hooks_callback_fn_t *func, void *cbdata
193193
int
194194
opal_mem_hooks_unregister_release(opal_mem_hooks_callback_fn_t* func)
195195
{
196-
callback_list_item_t *cbitem, *found_item;
196+
callback_list_item_t *cbitem, *found_item = NULL;
197197
int ret = OPAL_ERR_NOT_FOUND;
198198

199199
opal_atomic_lock(&release_lock);

0 commit comments

Comments
 (0)