if (objectArena) NSSArena_Destroy(objectArena);
nsstoken_TraverseObjects(  NSSToken *tok,  nssSession *session,  CK_ATTRIBUTE_PTR obj_template,  CK_ULONG otsize,  PRStatus (*callback)(NSSToken *t, nssSession *session,                       CK_OBJECT_HANDLE h, void *arg),  void *arg){    NSSSlot *slot;    PRStatus cbrv;    CK_RV ckrv;    CK_ULONG count;    CK_OBJECT_HANDLE object;    CK_SESSION_HANDLE hSession;    slot = tok->slot;    hSession = session->handle;    ckrv = CKAPI(slot)->C_FindObjectsInit(hSession, obj_template, otsize);    if (ckrv != CKR_OK) {	goto loser;    }    while (PR_TRUE) {	/* this could be sped up by getting 5-10 at a time? */	ckrv = CKAPI(slot)->C_FindObjects(hSession, &object, 1, &count);	if (ckrv != CKR_OK) {	    goto loser;	}	if (count == 0) {	    break;	}	cbrv = (*callback)(tok, session, object, arg);	if (cbrv != PR_SUCCESS) {	    NSSError e;	    if ((e = NSS_GetError()) == NSS_ERROR_MAXIMUM_FOUND) {		/* The maximum number of elements have been found, exit. */		nss_ClearErrorStack();		break;	    }	    goto loser;	}    }    ckrv = CKAPI(slot)->C_FindObjectsFinal(hSession);    if (ckrv != CKR_OK) {	goto loser;    }loser:    return NULL; /* for now... */}