From e25e69dc2fa89bc0b9fea8e8bb508254ae113f0c Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Sat, 7 Jan 2017 10:45:52 -0800 Subject: [PATCH] Resolve Coverity issues Signed-off-by: Ralph Castain --- opal/mca/pmix/pmix2x/pmix2x.c | 8 +++++++- orte/orted/pmix/pmix_server_gen.c | 3 +-- orte/orted/pmix/pmix_server_register_fns.c | 4 +++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/opal/mca/pmix/pmix2x/pmix2x.c b/opal/mca/pmix/pmix2x/pmix2x.c index ea8e6375fe..6a08416d7c 100644 --- a/opal/mca/pmix/pmix2x/pmix2x.c +++ b/opal/mca/pmix/pmix2x/pmix2x.c @@ -945,7 +945,13 @@ int pmix2x_value_unload(opal_value_t *kv, if (PMIX_INFO == v->data.darray->type) { pmix_info_t *iptr = (pmix_info_t*)v->data.darray->array; ival->key = strdup(iptr[n].key); - pmix2x_value_unload(ival, &iptr[n].value); + rc = pmix2x_value_unload(ival, &iptr[n].value); + if (OPAL_SUCCESS != rc) { + OPAL_LIST_RELEASE(lt); + kv->type = OPAL_UNDEF; + kv->data.ptr = NULL; + break; + } } } break; diff --git a/orte/orted/pmix/pmix_server_gen.c b/orte/orted/pmix/pmix_server_gen.c index 10534c5838..142cf43414 100644 --- a/orte/orted/pmix/pmix_server_gen.c +++ b/orte/orted/pmix/pmix_server_gen.c @@ -544,12 +544,11 @@ static void _query(int sd, short args, void *cbdata) } /* scan the qualifiers */ + local_only = false; OPAL_LIST_FOREACH(kv, &q->qualifiers, opal_value_t) { if (0 == strcmp(kv->key, OPAL_PMIX_QUERY_LOCAL_ONLY)) { if (OPAL_UNDEF == kv->type || kv->data.flag) { local_only = true; - } else { - local_only = false; } } else if (0 == strcmp(kv->key, OPAL_PMIX_PROCID)) { /* save this directive on our list of targets */ diff --git a/orte/orted/pmix/pmix_server_register_fns.c b/orte/orted/pmix/pmix_server_register_fns.c index d007b76c28..22c1a76856 100644 --- a/orte/orted/pmix/pmix_server_register_fns.c +++ b/orte/orted/pmix/pmix_server_register_fns.c @@ -332,7 +332,9 @@ int orte_pmix_server_register_nspace(orte_job_t *jdata) /* location, for local procs */ if (node == mynode) { - if (orte_get_attribute(&pptr->attributes, ORTE_PROC_CPU_BITMAP, (void**)&tmp, OPAL_STRING)) { + tmp = NULL; + if (orte_get_attribute(&pptr->attributes, ORTE_PROC_CPU_BITMAP, (void**)&tmp, OPAL_STRING) && + NULL != tmp) { kv = OBJ_NEW(opal_value_t); kv->key = strdup(OPAL_PMIX_LOCALITY_STRING); kv->type = OPAL_STRING;