if (rv == SECSuccess && digestsp) {
if (rv == SECSuccess && digestsp && digests) {
NSS_CMSDigestContext_FinishMultiple(NSSCMSDigestContext *cmsdigcx,                                     PLArenaPool *poolp,			            SECItem ***digestsp){    SECItem **  digests = NULL;    digestPair *pair;    void *      mark;    int         i;    SECStatus   rv;    /* no contents? do not finish digests */    if (digestsp == NULL || !cmsdigcx->saw_contents) {	rv = SECSuccess;	goto cleanup;    }    mark = PORT_ArenaMark (poolp);    /* allocate digest array & SECItems on arena */    digests = PORT_ArenaNewArray( poolp, SECItem *, cmsdigcx->digcnt + 1);    rv = ((digests == NULL) ? SECFailure : SECSuccess);    pair = cmsdigcx->digPairs;    for (i = 0; rv == SECSuccess && i < cmsdigcx->digcnt; i++, pair++) {	SECItem digest;	unsigned char hash[HASH_LENGTH_MAX];	if (!pair->digcx) {	    digests[i] = NULL;	    continue;	}	digest.type = siBuffer;	digest.data = hash;	digest.len  = pair->digobj->length;	(* pair->digobj->end)(pair->digcx, hash, &digest.len, digest.len);	digests[i] = SECITEM_ArenaDupItem(poolp, &digest);	if (!digests[i]) {	    rv = SECFailure;	}    }    digests[i] = NULL;    if (rv == SECSuccess) {	PORT_ArenaUnmark(poolp, mark);    } else	PORT_ArenaRelease(poolp, mark);cleanup:    NSS_CMSDigestContext_Cancel(cmsdigcx);    if (rv == SECSuccess && digestsp) {	*digestsp = digests;    }    return rv;}