src/mca/schizo/ompi/schizo_ompi.c
static int process_token(char *token, char ***cache, char ***cachevals)
{
    char *ptr, *value;
    int rc;

    if (NULL == (ptr = strchr(token, '='))) {
        value = getenv(token);
        if (NULL == value) {
            return PRTE_ERR_NOT_FOUND;
        }

        /* duplicate the value to silence tainted string coverity issue */
        value = strdup(value);
        if (NULL == value) {
            /* out of memory */
            return PRTE_ERR_OUT_OF_RESOURCE;
        }

        if (NULL != (ptr = strchr(value, '='))) {
            *ptr = '\0';
            rc = check_cache(cache, cachevals, value, ptr+1);
        } else {
            rc = check_cache(cache, cachevals, token, value);
        }

        free(value);
    } else {
        *ptr = '\0';
        rc = check_cache(cache, cachevals, token, ptr+1);
        /* NTH: don't bother resetting ptr to = since the string will not be used again */
    }
    return rc;
}
/* process params from an env_list - add them to the cache */
process params from an env_list - add them to the cache
process params from an env_list - add them to the cache
static int process_token(char *token, char ***cache, char ***cachevals)
{
    char *ptr, *value;
    int rc;
    if (NULL == (ptr = strchr(token, '='))) {
        value = getenv(token);
        if (NULL == value) {
            return PRTE_ERR_NOT_FOUND;
        }
        value = strdup(value);
        if (NULL == value) {
            return PRTE_ERR_OUT_OF_RESOURCE;
        }
        if (NULL != (ptr = strchr(value, '='))) {
            *ptr = '\0';
            rc = check_cache(cache, cachevals, value, ptr+1);
        } else {
            rc = check_cache(cache, cachevals, token, value);
        }
        free(value);
    } else {
        *ptr = '\0';
        rc = check_cache(cache, cachevals, token, ptr+1);
    }
    return rc;
}
static int process_token ( char * token , char * * * cache , char * * * cachevals ) { char * ptr , * value ; int rc ; if ( NULL == ( ptr = strchr ( token , ' ' ) ) ) { value = getenv ( token ) ; if ( NULL == value ) { return PRTE_ERR_NOT_FOUND ; } value = strdup ( value ) ; if ( NULL == value ) { return PRTE_ERR_OUT_OF_RESOURCE ; } if ( NULL != ( ptr = strchr ( value , ' ' ) ) ) { * ptr = ' \0 ' ; rc = check_cache ( cache , cachevals , value , ptr + 1 ) ; } else { rc = check_cache ( cache , cachevals , token , value ) ; } free ( value ) ; } else { * ptr = ' \0 ' ; rc = check_cache ( cache , cachevals , token , ptr + 1 ) ; } return rc ; }
process params from an env_list - add them to the cache
process params from an env_list - add them to the cache
/* duplicate the value to silence tainted string coverity issue */ /* out of memory */ /* NTH: don't bother resetting ptr to = since the string will not be used again */