PLArenaPool *arena;
pk11_NewObject(PK11Slot *slot){    PK11Object *object;    PLArenaPool *arena;    PRBool hasLocks = PR_FALSE;    int i;#ifdef NO_ARENA    object = pk11_GetObjectFromList(&hasLocks);    if (object == NULL) {	return NULL;    }    object->nextAttr = 0;#else    arena = PORT_NewArena(2048);    if (arena == NULL) return NULL;    object = (PK11Object*)PORT_ArenaAlloc(arena,sizeof(PK11Object));    if (object == NULL) {	PORT_FreeArena(arena,PR_FALSE);	return NULL;    }    object->arena = arena;    for (i=0; i < MAX_OBJS_ATTRS; i++) {	object->attrList[i].attrib.pValue = NULL;    }#endif    object->handle = 0;    object->next = object->prev = NULL;    object->sessionList.next = NULL;    object->sessionList.prev = NULL;    object->sessionList.parent = object;    object->inDB = PR_FALSE;    object->label = NULL;    object->refCount = 1;    object->session = NULL;    object->slot = slot;    object->objclass = 0xffff;    object->wasDerived = PR_FALSE;#ifdef PKCS11_USE_THREADS    if (!hasLocks) object->refLock = PZ_NewLock(nssILockRefLock);    if (object->refLock == NULL) {#ifdef NO_ARENA	PORT_Free(object);#else	PORT_FreeArena(arena,PR_FALSE);#endif	return NULL;    }    if (!hasLocks) object->attributeLock = PZ_NewLock(nssILockAttribute);    if (object->attributeLock == NULL) {	PK11_USE_THREADS(PZ_DestroyLock(object->refLock);)#ifdef NO_ARENA	PORT_Free(object);#else	PORT_FreeArena(arena,PR_FALSE);#endif	return NULL;    }#else    object->attributeLock = NULL;    object->refLock = NULL;#endif    for (i=0; i < ATTRIBUTE_HASH_SIZE; i++) {	object->head[i] = NULL;    }    object->objectInfo = NULL;    object->infoFree = NULL;    return object;}