nssrv = nssHash_Add(cache->subject, &cert->subject, ce);
subject = nssItem_Duplicate(&cert->subject, arena, NULL); if (!subject) { return PR_FAILURE; } nssrv = nssHash_Add(cache->subject, subject, ce);
add_subject_entry(  NSSArena *arena,  nssTDCertificateCache *cache,   NSSCertificate *cert,  nssList **subjectList){    PRStatus nssrv;    nssList *list;    cache_entry *ce;    *subjectList = NULL;  /* this is only set if a new one is created */    ce = (cache_entry *)nssHash_Lookup(cache->subject, &cert->subject);    if (ce) {	ce->hits++;	ce->lastHit = PR_Now();	/* The subject is already in, add this cert to the list */	nssrv = nssList_AddUnique(ce->entry.list, cert);#ifdef DEBUG_CACHE	log_cert_ref("added to existing subject list", cert);#endif    } else {	/* Create a new subject list for the subject */	list = nssList_Create(arena, PR_FALSE);	if (!list) {	    return PR_FAILURE;	}	ce = new_cache_entry(arena, (void *)list);	if (!ce) {	    return PR_FAILURE;	}	nssList_SetSortFunction(list, subject_list_sort);	/* Add the cert entry to this list of subjects */	nssrv = nssList_AddUnique(list, cert);	if (nssrv != PR_SUCCESS) {	    return nssrv;	}	/* Add the subject list to the cache */	nssrv = nssHash_Add(cache->subject, &cert->subject, ce);	if (nssrv != PR_SUCCESS) {	    return nssrv;	}	*subjectList = list;#ifdef DEBUG_CACHE	log_cert_ref("created subject list", cert);#endif    }    return nssrv;}