goto finish;
goto unlock;
nssTokenObjectCache_FindObjectsByTemplate (  nssTokenObjectCache *cache,  CK_OBJECT_CLASS objclass,  CK_ATTRIBUTE_PTR otemplate,  CK_ULONG otlen,  PRUint32 maximumOpt,  PRStatus *statusOpt){    PRStatus status = PR_FAILURE;    nssCryptokiObject **rvObjects = NULL;    PZ_Lock(cache->lock);    switch (objclass) {    case CKO_CERTIFICATE:	if (cache->doObjectType[cachedCerts]) {	    status = get_token_certs_for_cache(cache);	    if (status != PR_SUCCESS) {		goto finish;	    }	    rvObjects = find_objects_in_array(cache->objects[cachedCerts], 	                                      otemplate, otlen, maximumOpt);	}	break;    case CKO_NETSCAPE_TRUST:	if (cache->doObjectType[cachedTrust]) {	    status = get_token_trust_for_cache(cache);	    if (status != PR_SUCCESS) {		goto finish;	    }	    rvObjects = find_objects_in_array(cache->objects[cachedTrust], 	                                      otemplate, otlen, maximumOpt);	}	break;    case CKO_NETSCAPE_CRL:	if (cache->doObjectType[cachedCRLs]) {	    status = get_token_crls_for_cache(cache);	    if (status != PR_SUCCESS) {		goto finish;	    }	    rvObjects = find_objects_in_array(cache->objects[cachedCRLs], 	                                      otemplate, otlen, maximumOpt);	}	break;    default: break;    }finish:    PZ_Unlock(cache->lock);    if (statusOpt) {	*statusOpt = status;    }    return rvObjects;}