if (!token_is_present(cache)) { return PR_SUCCESS;  }
nssTokenObjectCache_ImportObject (  nssTokenObjectCache *cache,  nssCryptokiObject *object,  CK_OBJECT_CLASS objclass,  CK_ATTRIBUTE_PTR ot,  CK_ULONG otlen){    PRStatus status = PR_SUCCESS;    PRUint32 count;    nssCryptokiObjectAndAttributes **oa, ***otype;    PRUint32 objectType;    PRBool haveIt = PR_FALSE;    PZ_Lock(cache->lock);    switch (objclass) {    case CKO_CERTIFICATE:    objectType = cachedCerts; break;    case CKO_NETSCAPE_TRUST: objectType = cachedTrust; break;    case CKO_NETSCAPE_CRL:   objectType = cachedCRLs;  break;    default:	PZ_Unlock(cache->lock);	return PR_SUCCESS; /* don't need to import it here */    }    if (!cache_available_for_object_type(cache, objectType)) {	PZ_Unlock(cache->lock);	return PR_SUCCESS; /* cache not active, ignored */    }    count = 0;    otype = &cache->objects[objectType]; /* index into array of types */    oa = *otype; /* the array of objects for this type */    while (oa && *oa) {	if (nssCryptokiObject_Equal((*oa)->object, object)) {	    haveIt = PR_TRUE;	    break;	}	count++;	oa++;    }    if (haveIt) {	/* Destroy the old entry */	(*oa)->object->token = NULL;	nssCryptokiObject_Destroy((*oa)->object);	nssArena_Destroy((*oa)->arena);    } else {	/* Create space for a new entry */	if (count > 0) {	    *otype = nss_ZREALLOCARRAY(*otype,	                               nssCryptokiObjectAndAttributes *, 	                               count + 2);	} else {	    *otype = nss_ZNEWARRAY(NULL, nssCryptokiObjectAndAttributes *, 2);	}    }    if (*otype) {	nssCryptokiObject *copyObject = nssCryptokiObject_Clone(object);	if (objectType == cachedCerts) {	    (*otype)[count] = create_cert(copyObject, &status);	} else if (objectType == cachedTrust) {	    (*otype)[count] = create_trust(copyObject, &status);	} else if (objectType == cachedCRLs) {	    (*otype)[count] = create_crl(copyObject, &status);	}    } else {	status = PR_FAILURE;    }    PZ_Unlock(cache->lock);    return status;}