if (!oldie) { continue; }
PK11_TraverseCertsInSlot(PK11SlotInfo *slot,	SECStatus(* callback)(CERTCertificate*, void *), void *arg){#ifdef NSS_CLASSIC    pk11DoCertCallback caller;    pk11TraverseSlot callarg;    CK_OBJECT_CLASS certClass = CKO_CERTIFICATE;    CK_ATTRIBUTE theTemplate[] = {	{ CKA_CLASS, NULL, 0 },    };    CK_ATTRIBUTE *attr = theTemplate;    int templateSize = sizeof(theTemplate)/sizeof(theTemplate[0]);    PK11_SETATTRS(attr,CKA_CLASS, &certClass, sizeof(certClass)); attr++;    if (slot == NULL) {	return SECSuccess;    }    caller.noslotcallback = callback;    caller.callback = NULL;    caller.itemcallback = NULL;    caller.callbackArg = arg;    callarg.callback = pk11_DoCerts;    callarg.callbackArg = (void *) & caller;    callarg.findTemplate = theTemplate;    callarg.templateCount = templateSize;    return PK11_TraverseSlot(slot, &callarg);#else    PRStatus nssrv;    NSSTrustDomain *td = STAN_GetDefaultTrustDomain();    NSSToken *tok;    nssList *certList = NULL;    nssCryptokiObject **instances;    nssPKIObjectCollection *collection;    NSSCertificate **certs;    nssTokenSearchType tokenOnly = nssTokenSearchType_TokenOnly;    tok = PK11Slot_GetNSSToken(slot);    if (!nssToken_IsPresent(tok)) {	return SECSuccess;    }    collection = nssCertificateCollection_Create(td, NULL);    if (!collection) {	return SECFailure;    }    certList = nssList_Create(NULL, PR_FALSE);    if (!certList) {	nssPKIObjectCollection_Destroy(collection);	return SECFailure;    }    (void *)nssTrustDomain_GetCertsFromCache(td, certList);    transfer_token_certs_to_collection(certList, tok, collection);    instances = nssToken_FindCertificates(tok, NULL,                                          tokenOnly, 0, &nssrv);    nssPKIObjectCollection_AddInstances(collection, instances, 0);    nss_ZFreeIf(instances);    nssList_Destroy(certList);    certs = nssPKIObjectCollection_GetCertificates(collection,                                                   NULL, 0, NULL);    nssPKIObjectCollection_Destroy(collection);    if (certs) {	CERTCertificate *oldie;	NSSCertificate **cp;	for (cp = certs; *cp; cp++) {	    oldie = STAN_GetCERTCertificate(*cp);	    if ((*callback)(oldie, arg) != SECSuccess) {		nssrv = PR_FAILURE;		break;	    }	}	nssCertificateArray_Destroy(certs);    }    return (nssrv == PR_SUCCESS) ? SECSuccess : SECFailure;#endif}