if (!isUnique) {
if (!isUnique && cert->nickname) {
pk11ListCertCallback(CERTCertificate *cert, SECItem *derCert, void *arg){    struct listCertsStr *listCertP = (struct listCertsStr *)arg;    CERTCertificate *newCert = NULL;    PK11CertListType type = listCertP->type;    CERTCertList *certList = listCertP->certList;    CERTCertTrust *trust;    PRBool isUnique = PR_FALSE;    char *nickname = NULL;    unsigned int certType;    if ((type == PK11CertListUnique) || (type == PK11CertListRootUnique)) {	isUnique = PR_TRUE;    }    /* at this point the nickname is correct for the cert. save it for later */    if (!isUnique) {         nickname = PORT_ArenaStrdup(listCertP->certList->arena,cert->nickname);    }    if (derCert == NULL) {	newCert=CERT_DupCertificate(cert);    } else {	newCert=CERT_FindCertByDERCert(CERT_GetDefaultCertDB(),&cert->derCert);    }    if (newCert == NULL) return SECSuccess;    trust = newCert->trust;    /* if we want user certs and we don't have one skip this cert */    if ((type == PK11CertListUser) && 	  ((trust == NULL) || 		( ((trust->sslFlags & CERTDB_USER) == 0)  && 			((trust->emailFlags & CERTDB_USER) == 0) )) ) {	CERT_DestroyCertificate(newCert);	return SECSuccess;    }    /* if we want root certs, skip the user certs */    if ((type == PK11CertListRootUnique) && 	  ((trust) && (((trust->sslFlags & CERTDB_USER )  || 				(trust->emailFlags & CERTDB_USER))) ) ) {	CERT_DestroyCertificate(newCert);	return SECSuccess;    }    /* if we want Unique certs and we already have it on our list, skip it */    if ( isUnique && isOnList(certList,newCert) ) {	CERT_DestroyCertificate(newCert);	return SECSuccess;    }    /* if we want CA certs and it ain't one, skip it */    if( type == PK11CertListCA  && (!CERT_IsCACert(newCert, &certType)) ) {	CERT_DestroyCertificate(newCert);	return SECSuccess;    }    /* put slot certs at the end */    if (newCert->slot && !PK11_IsInternal(newCert->slot)) {    	CERT_AddCertToListTailWithData(certList,newCert,nickname);    } else {    	CERT_AddCertToListHeadWithData(certList,newCert,nickname);    }    return SECSuccess;}