safeContentsCtx->currentSafeBag->tokenCAs = safeContentsCtx->p12dcx->tokenCAs;
sec_pkcs12_decoder_init_new_safe_bag(sec_PKCS12SafeContentsContext 						*safeContentsCtx){    void *mark = NULL;    SEC_PKCS12DecoderContext *p12dcx;    /* make sure that the structures are defined, and there has     * not been an error in the decoding      */    if(!safeContentsCtx || !safeContentsCtx->p12dcx 		|| safeContentsCtx->p12dcx->error) {	return SECFailure;    }    p12dcx = safeContentsCtx->p12dcx;    mark = PORT_ArenaMark(p12dcx->arena);    /* allocate a new safe bag, if bags already exist, grow the      * list of bags, otherwise allocate a new list.  the list is     * NULL terminated.     */    if(p12dcx->safeBagCount) {	p12dcx->safeBags = 	    (sec_PKCS12SafeBag**)PORT_ArenaGrow(p12dcx->arena,p12dcx->safeBags,			(p12dcx->safeBagCount + 1) * sizeof(sec_PKCS12SafeBag *),			(p12dcx->safeBagCount + 2) * sizeof(sec_PKCS12SafeBag *));    } else {	p12dcx->safeBags = (sec_PKCS12SafeBag**)PORT_ArenaZAlloc(p12dcx->arena,					    2 * sizeof(sec_PKCS12SafeBag *));    }    if(!p12dcx->safeBags) {	p12dcx->errorValue = SEC_ERROR_NO_MEMORY;	goto loser;    }    /* append the bag to the end of the list and update the reference     * in the safeContentsCtx.     */    p12dcx->safeBags[p12dcx->safeBagCount] =         (sec_PKCS12SafeBag*)PORT_ArenaZAlloc(p12dcx->arena,					     sizeof(sec_PKCS12SafeBag));    safeContentsCtx->currentSafeBag = p12dcx->safeBags[p12dcx->safeBagCount];    p12dcx->safeBags[++p12dcx->safeBagCount] = NULL;    if(!safeContentsCtx->currentSafeBag) {	p12dcx->errorValue = SEC_ERROR_NO_MEMORY;	goto loser;    }    safeContentsCtx->currentSafeBag->slot = safeContentsCtx->p12dcx->slot;    safeContentsCtx->currentSafeBag->pwitem = safeContentsCtx->p12dcx->pwitem;    safeContentsCtx->currentSafeBag->swapUnicodeBytes = 				safeContentsCtx->p12dcx->swapUnicodeBytes;    safeContentsCtx->currentSafeBag->arena = safeContentsCtx->p12dcx->arena;    PORT_ArenaUnmark(p12dcx->arena, mark);    return SECSuccess;loser:    /* if an error occurred, release the memory and set the error flag     * the only possible errors triggered by this function are memory      * related.     */    if(mark) {	PORT_ArenaRelease(p12dcx->arena, mark);    }    p12dcx->error = PR_TRUE;    return SECFailure;}