digests[i] = NULL;
NSS_CMSDigestContext_FinishMultiple(NSSCMSDigestContext *cmsdigcx,                                     PLArenaPool *poolp,			            SECItem ***digestsp){    const SECHashObject *digobj;    void *digcx;    SECItem **digests = NULL, *digest;    int i;    void *mark;    SECStatus rv = SECFailure;    /* no contents? do not update digests */    if (digestsp == NULL || !cmsdigcx->saw_contents) {	for (i = 0; i < cmsdigcx->digcnt; i++) {	    (*cmsdigcx->digobjs[i]->destroy)(cmsdigcx->digcxs[i], PR_TRUE);#ifdef CMS_FIND_LEAK_MULTIPLE	    --num_digests;#endif	}	rv = SECSuccess;	goto cleanup;    }    mark = PORT_ArenaMark (poolp);    /* allocate digest array & SECItems on arena */    digests = PORT_ArenaNewArray( poolp, SECItem *, cmsdigcx->digcnt + 1);    digest  = PORT_ArenaZNewArray(poolp, SECItem,   cmsdigcx->digcnt    );    if (digests == NULL || digest == NULL) {	rv = SECFailure;    } else {	rv = SECSuccess;    }    for (i = 0; i < cmsdigcx->digcnt; i++, digest++) {	digcx = cmsdigcx->digcxs[i];	digobj = cmsdigcx->digobjs[i];	if (rv != SECSuccess) {	    /* skip it */	} else {	    digest->data = 	        (unsigned char*)PORT_ArenaAlloc(poolp, digobj->length);	    if (digest->data != NULL) {		digest->len = digobj->length;		(* digobj->end)(digcx, digest->data, &(digest->len), 		                       digest->len);		digests[i] = digest;	    } else {		rv = SECFailure;	    }	}	(* digobj->destroy)(digcx, PR_TRUE);#ifdef CMS_FIND_LEAK_MULTIPLE	--num_digests;#endif    }    if (rv == SECSuccess) {	digests[i] = NULL;	PORT_ArenaUnmark(poolp, mark);    } else	PORT_ArenaRelease(poolp, mark);cleanup:#ifdef CMS_FIND_LEAK_MULTIPLE    PORT_Assert( num_digests == 0 || !stop_on_err);#endif    if (cmsdigcx->digobjs)	PORT_Free((void *)cmsdigcx->digobjs); /* cast away const */    if (cmsdigcx->digcxs)	PORT_Free(cmsdigcx->digcxs);    PORT_Free(cmsdigcx);    if (rv == SECSuccess && digestsp) {	*digestsp = digests;    }    return rv;}