rv = CERT_CopyRDN(arena, trdn, frdn); if (rv) return rv; rv = CERT_AddRDN(to, trdn); if (rv) return rv;
while ((frdn = *rdns++) != NULL) { trdn = CERT_CreateRDN(arena, 0); if (!trdn) { rv = SECFailure; break; } rv = CERT_CopyRDN(arena, trdn, frdn); if (rv != SECSuccess) break; rv = CERT_AddRDN(to, trdn); if (rv != SECSuccess) break; }
CERT_CopyName(PRArenaPool *arena, CERTName *to, CERTName *from){    CERTRDN **rdns, *frdn, *trdn;    SECStatus rv;    if (!to || !from)	return SECFailure;    CERT_DestroyName(to);    to->arena = arena;    /* Copy each rdn from from */    rdns = from->rdns;    while ((frdn = *rdns++) != 0) {	trdn = CERT_CreateRDN(arena, 0);	if ( trdn == NULL ) {	    return(SECFailure);	}	rv = CERT_CopyRDN(arena, trdn, frdn);	if (rv) return rv;	rv = CERT_AddRDN(to, trdn);	if (rv) return rv;    }    return SECSuccess;}