entry->emailAddrs[0] = (char *)PORT_ArenaAlloc(arena, eaddrlen);
NewDBSubjectEntry(SECItem *derSubject, SECItem *certKey,		  SECItem *keyID, char *nickname, char *emailAddr,		  unsigned int flags){    PRArenaPool *arena = NULL;    certDBEntrySubject *entry;    SECStatus rv;    unsigned int nnlen;    unsigned int eaddrlen;        arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);    if ( arena == NULL ) {	PORT_SetError(SEC_ERROR_NO_MEMORY);	goto loser;    }    entry = (certDBEntrySubject *)PORT_ArenaAlloc(arena,						  sizeof(certDBEntrySubject));    if ( entry == NULL ) {	PORT_SetError(SEC_ERROR_NO_MEMORY);	goto loser;    }    /* init common fields */    entry->common.arena = arena;    entry->common.type = certDBEntryTypeSubject;    entry->common.version = CERT_DB_FILE_VERSION;    entry->common.flags = flags;    /* copy the subject */    rv = SECITEM_CopyItem(arena, &entry->derSubject, derSubject);    if ( rv != SECSuccess ) {	goto loser;    }        entry->ncerts = 1;    entry->nemailAddrs = 0;    /* copy nickname */    if ( nickname && ( *nickname != '\0' ) ) {	nnlen = PORT_Strlen(nickname) + 1;	entry->nickname = (char *)PORT_ArenaAlloc(arena, nnlen);	if ( entry->nickname == NULL ) {	    goto loser;	}						  	PORT_Memcpy(entry->nickname, nickname, nnlen);    } else {	entry->nickname = NULL;    }        /* copy email addr */    if ( emailAddr && ( *emailAddr != '\0' ) ) {	emailAddr = nsslowcert_FixupEmailAddr(emailAddr);	if ( emailAddr == NULL ) {	    entry->emailAddrs = NULL;	    goto loser;	}		eaddrlen = PORT_Strlen(emailAddr) + 1;	entry->emailAddrs = (char **)PORT_ArenaAlloc(arena, sizeof(char *));	if ( entry->emailAddrs == NULL ) {	    PORT_Free(emailAddr);	    goto loser;	}	entry->emailAddrs[0] = (char *)PORT_ArenaAlloc(arena, eaddrlen);	entry->emailAddrs[0] = PORT_ArenaStrdup(arena,emailAddr);	if (entry->emailAddrs[0]) {	    entry->nemailAddrs = 1;	} else {	    entry->emailAddrs[0] = NULL;	}		PORT_Free(emailAddr);    } else {	entry->emailAddrs = NULL;    }        /* allocate space for certKeys and keyIDs */    entry->certKeys = (SECItem *)PORT_ArenaAlloc(arena, sizeof(SECItem));    entry->keyIDs = (SECItem *)PORT_ArenaAlloc(arena, sizeof(SECItem));    if ( ( entry->certKeys == NULL ) || ( entry->keyIDs == NULL ) ) {	goto loser;    }    /* copy the certKey and keyID */    rv = SECITEM_CopyItem(arena, &entry->certKeys[0], certKey);    if ( rv != SECSuccess ) {	goto loser;    }    rv = SECITEM_CopyItem(arena, &entry->keyIDs[0], keyID);    if ( rv != SECSuccess ) {	goto loser;    }        return(entry);loser:    if ( arena ) {	PORT_FreeArena(arena, PR_FALSE);    }        return(NULL);}