if (rwsession == CK_INVALID_SESSION) { PORT_SetError(SEC_ERROR_BAD_DATA); return SECFailure; }
PK11_DestroyTokenObject(PK11SlotInfo *slot,CK_OBJECT_HANDLE object) {    CK_RV crv;    SECStatus rv = SECSuccess;    CK_SESSION_HANDLE rwsession;        rwsession = PK11_GetRWSession(slot);    crv = PK11_GETTAB(slot)->C_DestroyObject(rwsession,object);    if (crv != CKR_OK) {	rv = SECFailure;	PORT_SetError(PK11_MapError(crv));    }    PK11_RestoreROSession(slot,rwsession);    return rv;}