symKey->next = slot->freeSymKeysHead; slot->freeSymKeysHead = symKey;
if (symKey->sessionOwner) { PORT_Assert (symKey->session != CK_INVALID_SESSION); symKey->next = slot->freeSymKeysWithSessionHead; slot->freeSymKeysWithSessionHead = symKey; } else { symKey->session = CK_INVALID_SESSION; symKey->next = slot->freeSymKeysHead; slot->freeSymKeysHead = symKey; }
PK11_FreeSymKey(PK11SymKey *symKey){    PK11SlotInfo *slot;    PRBool freeit = PR_TRUE;    if (PR_AtomicDecrement(&symKey->refCount) == 0) {	PK11SymKey *parent = symKey->parent;	symKey->parent = NULL;	if ((symKey->owner) && symKey->objectID != CK_INVALID_HANDLE) {	    pk11_EnterKeyMonitor(symKey);	    (void) PK11_GETTAB(symKey->slot)->		C_DestroyObject(symKey->session, symKey->objectID);	    pk11_ExitKeyMonitor(symKey);	}	if (symKey->data.data) {	    PORT_Memset(symKey->data.data, 0, symKey->data.len);	    PORT_Free(symKey->data.data);	}        slot = symKey->slot;        PZ_Lock(slot->freeListLock);	if (slot->keyCount < slot->maxKeyCount) {	    symKey->next = slot->freeSymKeysHead;	    slot->freeSymKeysHead = symKey;	    slot->keyCount++;	    symKey->slot = NULL;	    freeit = PR_FALSE;        }	PZ_Unlock(slot->freeListLock);        if (freeit) {	    pk11_CloseSession(symKey->slot, symKey->session,							symKey->sessionOwner);	    PORT_Free(symKey);	}	PK11_FreeSlot(slot);	if (parent) {	    PK11_FreeSymKey(parent);	}    }}