diff --git a/opal/mca/pmix/pmix.h b/opal/mca/pmix/pmix.h index d179ba0511..f78efa4857 100644 --- a/opal/mca/pmix/pmix.h +++ b/opal/mca/pmix/pmix.h @@ -199,6 +199,8 @@ extern int opal_pmix_base_exchange(opal_value_t *info, *(sz) = _kv->data.bo.size; \ _kv->data.bo.bytes = NULL; /* protect the data */ \ OBJ_RELEASE(_kv); \ + } else { \ + *(sz) = 0; \ } \ } while(0); diff --git a/orte/orted/pmix/pmix_server_fence.c b/orte/orted/pmix/pmix_server_fence.c index 7ab0ef73e7..b3b0e33059 100644 --- a/orte/orted/pmix/pmix_server_fence.c +++ b/orte/orted/pmix/pmix_server_fence.c @@ -129,8 +129,8 @@ static void dmodex_req(int sd, short args, void *cbdata) orte_proc_t *proct, *dmn; int rc, rnum; opal_buffer_t *buf; - uint8_t *data; - int32_t sz; + uint8_t *data=NULL; + int32_t sz=0; /* a race condition exists here because of the thread-shift - it is * possible that data for the specified proc arrived while we were diff --git a/orte/runtime/orte_globals.c b/orte/runtime/orte_globals.c index cbfb957ca5..c4efb64987 100644 --- a/orte/runtime/orte_globals.c +++ b/orte/runtime/orte_globals.c @@ -465,7 +465,7 @@ orte_vpid_t orte_get_proc_daemon_vpid(orte_process_name_t *proc) char* orte_get_proc_hostname(orte_process_name_t *proc) { orte_proc_t *proct; - char *hostname; + char *hostname = NULL; int rc; /* don't bother error logging any not-found situations @@ -507,12 +507,13 @@ orte_node_rank_t orte_get_proc_node_rank(orte_process_name_t *proc) } /* if we are an app, get the value from the modex db */ + noderank = &nd; OPAL_MODEX_RECV_VALUE(rc, OPAL_PMIX_NODE_RANK, (opal_process_name_t*)proc, &noderank, ORTE_NODE_RANK); - - nd = *noderank; - free(noderank); + if (OPAL_SUCCESS != rc) { + nd = ORTE_NODE_RANK_INVALID; + } return nd; }