nssList_Clear(subjectList, cert_destructor);
NSSTrustDomain_FindCertificatesBySubject(  NSSTrustDomain *td,  NSSDER *subject,  NSSCertificate *rvOpt[],  PRUint32 maximumOpt, /* 0 for no max */  NSSArena *arenaOpt){    PRStatus nssrv;    NSSCertificate **rvCerts = NULL;    NSSToken *token;    PRUint32 count;    nssList *subjectList;    struct collect_arg_str ca;    nssTokenCertSearch search;    /* set up the collection */    subjectList = nssList_Create(NULL, PR_FALSE);    (void)nssTrustDomain_GetCertsForSubjectFromCache(td, subject, subjectList);    ca.list = subjectList;    ca.maximum = maximumOpt;    /* set the search criteria */    search.callback = collect_certs;    search.cbarg = &ca;    search.cached = subjectList;    search.searchType = nssTokenSearchType_TokenOnly;    /* traverse the tokens */    for (token  = (NSSToken *)nssListIterator_Start(td->tokens);         token != (NSSToken *)NULL;         token  = (NSSToken *)nssListIterator_Next(td->tokens))    {	nssrv = nssToken_TraverseCertificatesBySubject(token, NULL, 	                                               subject, &search);    }    nssListIterator_Finish(td->tokens);    count = nssList_Count(subjectList);    if (maximumOpt > 0 && count > maximumOpt) count = maximumOpt;    if (count > 0) {	if (rvOpt) {	    nssList_GetArray(subjectList, (void **)rvOpt, count);	    rvOpt[count] = NULL;	} else {	    rvCerts = nss_ZNEWARRAY(arenaOpt, NSSCertificate *, count + 1);	    nssList_GetArray(subjectList, (void **)rvCerts, count);	}	nssTrustDomain_AddCertsToCache(td, rvCerts, count);    }    nssList_Clear(subjectList, cert_destructor);    nssList_Destroy(subjectList);    return rvCerts;}