dbkey->len = certKey->len + SEC_DB_KEY_HEADER_LEN; dbkey->data = (unsigned char *)PORT_ArenaAlloc(arena, dbkey->len);
unsigned int len = certKey->len + SEC_DB_KEY_HEADER_LEN; if (arena) { dbkey->data = (unsigned char *)PORT_ArenaAlloc(arena, len); } else { if (dbkey->len < len) { dbkey->data = (unsigned char *)PORT_Alloc(dbkey->len); } } dbkey->len = len;
EncodeDBCertKey(SECItem *certKey, PRArenaPool *arena, SECItem *dbkey){    dbkey->len = certKey->len + SEC_DB_KEY_HEADER_LEN;    dbkey->data = (unsigned char *)PORT_ArenaAlloc(arena, dbkey->len);    if ( dbkey->data == NULL ) {	goto loser;    }    PORT_Memcpy(&dbkey->data[SEC_DB_KEY_HEADER_LEN],	      certKey->data, certKey->len);    dbkey->data[0] = certDBEntryTypeCert;    return(SECSuccess);loser:    return(SECFailure);}