1
1
Fixes coverity CIDs 1412984, and 1412983.

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
Этот коммит содержится в:
Nathan Hjelm 2017-06-23 08:15:34 -06:00
родитель 0c258c32e8
Коммит db973437e1
2 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -257,7 +257,7 @@ void opal_graph_add_vertex(opal_graph_t *graph, opal_graph_vertex_t *vertex)
int opal_graph_add_edge(opal_graph_t *graph, opal_graph_edge_t *edge)
{
opal_adjacency_list_t *aj_list, *start_aj_list= NULL;
bool start_found = false, end_found = false;
bool end_found = false;
/**
@ -265,7 +265,6 @@ int opal_graph_add_edge(opal_graph_t *graph, opal_graph_edge_t *edge)
*/
OPAL_LIST_FOREACH(aj_list, graph->adjacency_list, opal_adjacency_list_t) {
if (aj_list->vertex == edge->start) {
start_found = true;
start_aj_list = aj_list;
}
if (aj_list->vertex == edge->end) {
@ -276,7 +275,7 @@ int opal_graph_add_edge(opal_graph_t *graph, opal_graph_edge_t *edge)
* if one of the vertices either the start or the end is not
* found - return an error.
*/
if (false == start_found && false == end_found) {
if (NULL == start_aj_list || false == end_found) {
return OPAL_ERROR;
}
/* point the edge to the adjacency list of the start vertex (for easy search) */

Просмотреть файл

@ -193,7 +193,7 @@ opal_mem_hooks_register_release(opal_mem_hooks_callback_fn_t *func, void *cbdata
int
opal_mem_hooks_unregister_release(opal_mem_hooks_callback_fn_t* func)
{
callback_list_item_t *cbitem, *found_item;
callback_list_item_t *cbitem, *found_item = NULL;
int ret = OPAL_ERR_NOT_FOUND;
opal_atomic_lock(&release_lock);