Silence Coverity warnings
Этот коммит содержится в:
родитель
82240f579a
Коммит
1d44f0c0e2
@ -30,7 +30,7 @@ greek=
|
||||
# command, or with the date (if "git describe" fails) in the form of
|
||||
# "date<date>".
|
||||
|
||||
repo_rev=gitc2e543b
|
||||
repo_rev=gitdff97ad
|
||||
|
||||
# If tarball_version is not empty, it is used as the version string in
|
||||
# the tarball filename, regardless of all other versions listed in
|
||||
@ -44,7 +44,7 @@ tarball_version=
|
||||
|
||||
# The date when this release was created
|
||||
|
||||
date="Aug 10, 2016"
|
||||
date="Aug 11, 2016"
|
||||
|
||||
# The shared library version of each of PMIx's public libraries.
|
||||
# These versions are maintained in accordance with the "Library
|
||||
|
@ -679,11 +679,15 @@ pmix_status_t pmix_value_xfer(pmix_value_t *p, pmix_value_t *src)
|
||||
memcpy(p->data.darray.array, src->data.darray.array, src->data.darray.size * sizeof(pmix_persistence_t));
|
||||
break;
|
||||
case PMIX_POINTER:
|
||||
p->data.darray.array = (void**)malloc(src->data.darray.size * sizeof(void*));
|
||||
p->data.darray.array = (char**)malloc(src->data.darray.size * sizeof(char*));
|
||||
if (NULL == p->data.darray.array) {
|
||||
return PMIX_ERR_NOMEM;
|
||||
}
|
||||
memcpy(p->data.darray.array, src->data.darray.array, src->data.darray.size * sizeof(void*));
|
||||
prarray = (char**)p->data.darray.array;
|
||||
strarray = (char**)src->data.darray.array;
|
||||
for (n=0; n < src->data.darray.size; n++) {
|
||||
prarray[n] = strarray[n];
|
||||
}
|
||||
break;
|
||||
case PMIX_SCOPE:
|
||||
p->data.darray.array = (pmix_scope_t*)malloc(src->data.darray.size * sizeof(pmix_scope_t));
|
||||
@ -1135,6 +1139,8 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
|
||||
sv = (pmix_value_t*)src->array;
|
||||
for (n=0; n < src->size; n++) {
|
||||
if (PMIX_SUCCESS != (rc = pmix_value_xfer(&pv[n], &sv[n]))) {
|
||||
PMIX_VALUE_FREE(pv, src->size);
|
||||
free(p);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
@ -1265,6 +1271,8 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
|
||||
return PMIX_ERR_NOMEM;
|
||||
}
|
||||
if (PMIX_SUCCESS != (rc = pmix_value_xfer(pk[n].value, sk[n].value))) {
|
||||
PMIX_VALUE_FREE(pk[n].value, 1);
|
||||
free(p);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
@ -1283,6 +1291,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
|
||||
if (NULL != sm[n].blob && 0 < sm[n].size) {
|
||||
pm[n].blob = (uint8_t*)malloc(sm[n].size);
|
||||
if (NULL == pm[n].blob) {
|
||||
PMIX_MODEX_FREE(pm, src->size);
|
||||
free(p);
|
||||
return PMIX_ERR_NOMEM;
|
||||
}
|
||||
@ -1303,12 +1312,12 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
|
||||
memcpy(p->array, src->array, src->size * sizeof(pmix_persistence_t));
|
||||
break;
|
||||
case PMIX_POINTER:
|
||||
p->array = (void**)malloc(src->size * sizeof(void*));
|
||||
if (NULL == p->array) {
|
||||
free(p);
|
||||
return PMIX_ERR_NOMEM;
|
||||
p->array = (char**)malloc(src->size * sizeof(char*));
|
||||
prarray = (char**)p->array;
|
||||
strarray = (char**)src->array;
|
||||
for (n=0; n < src->size; n++) {
|
||||
prarray[n] = strarray[n];
|
||||
}
|
||||
memcpy(p->array, src->array, src->size * sizeof(void*));
|
||||
break;
|
||||
case PMIX_SCOPE:
|
||||
p->array = (pmix_scope_t*)malloc(src->size * sizeof(pmix_scope_t));
|
||||
|
@ -392,6 +392,7 @@ static pmix_status_t process_val(pmix_value_t *val,
|
||||
{
|
||||
pmix_info_t *info;
|
||||
size_t n, nsize, nvals;
|
||||
pmix_status_t rc;
|
||||
|
||||
if (NULL == val) {
|
||||
/* this is an error */
|
||||
@ -418,7 +419,9 @@ static pmix_status_t process_val(pmix_value_t *val,
|
||||
}
|
||||
nvals = 0;
|
||||
for (n=0; n < nsize; n++) {
|
||||
pmix_pointer_array_add(results, &info[n]);
|
||||
if (PMIX_SUCCESS != (rc = pmix_pointer_array_add(results, &info[n]))) {
|
||||
return rc;
|
||||
}
|
||||
++nvals;
|
||||
}
|
||||
if (PMIX_DATA_ARRAY == val->type) {
|
||||
|
@ -233,9 +233,11 @@ PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc,
|
||||
} else if (strcmp(info[n].key, PMIX_CONNECT_SYSTEM_FIRST) == 0) {
|
||||
connect_to_system_first = info[n].value.data.flag;
|
||||
connection_defined = true;
|
||||
} else if (strcmp(info[n].key, PMIX_SERVER_TMPDIR) == 0) {
|
||||
} else if (strcmp(info[n].key, PMIX_SERVER_TMPDIR) == 0 &&
|
||||
NULL == mytmpdir) {
|
||||
mytmpdir = strdup(info[n].value.data.string);
|
||||
} else if (strcmp(info[n].key, PMIX_SYSTEM_TMPDIR) == 0) {
|
||||
} else if (strcmp(info[n].key, PMIX_SYSTEM_TMPDIR) == 0 &&
|
||||
NULL == systmpdir) {
|
||||
systmpdir = strdup(info[n].value.data.string);
|
||||
}
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user