1
1

Fix a bug that would cause a segfault when someone specified an option that had no corresponding value

This commit was SVN r12288.
Этот коммит содержится в:
Ralph Castain 2006-10-24 22:06:18 +00:00
родитель dec51d7cf7
Коммит 46166a9c77

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

@ -463,11 +463,20 @@ int orte_rmaps_base_store_mapping_plan(orte_jobid_t job, opal_list_t *attr_list)
/* copy the data that is to be stored */ /* copy the data that is to be stored */
for (i=0, j=0; i < num_attrs_defd; i++) { for (i=0, j=0; i < num_attrs_defd; i++) {
if (NULL != (attr = orte_rmgr.find_attribute(attr_list, attrs[i]))) { if (NULL != (attr = orte_rmgr.find_attribute(attr_list, attrs[i]))) {
if (ORTE_SUCCESS != (rc = orte_gpr.create_keyval(&(value->keyvals[j]), attr->key, if (NULL != attr->value) {
attr->value->type, attr->value->data))) { if (ORTE_SUCCESS != (rc = orte_gpr.create_keyval(&(value->keyvals[j]), attr->key,
ORTE_ERROR_LOG(rc); attr->value->type, attr->value->data))) {
OBJ_RELEASE(value); ORTE_ERROR_LOG(rc);
return rc; OBJ_RELEASE(value);
return rc;
}
} else {
if (ORTE_SUCCESS != (rc = orte_gpr.create_keyval(&(value->keyvals[j]), attr->key,
ORTE_UNDEF, NULL))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(value);
return rc;
}
} }
j++; j++;
} }