if (!CRYPTO_dup_ex_data(bio_meth,&new->ex_data,&bio->ex_data))
if (!CRYPTO_dup_ex_data(CRYPTO_EX_INDEX_BIO, &new->ex_data, &bio->ex_data))
BIO *BIO_dup_chain(BIO *in)	{	BIO *ret=NULL,*eoc=NULL,*bio,*new;	for (bio=in; bio != NULL; bio=bio->next_bio)		{		if ((new=BIO_new(bio->method)) == NULL) goto err;		new->callback=bio->callback;		new->cb_arg=bio->cb_arg;		new->init=bio->init;		new->shutdown=bio->shutdown;		new->flags=bio->flags;		/* This will let SSL_s_sock() work with stdin/stdout */		new->num=bio->num;		if (!BIO_dup_state(bio,(char *)new))			{			BIO_free(new);			goto err;			}		/* copy app data */		if (!CRYPTO_dup_ex_data(bio_meth,&new->ex_data,&bio->ex_data))			goto err;		if (ret == NULL)			{			eoc=new;			ret=eoc;			}		else			{			BIO_push(eoc,new);			eoc=new;			}		}	return(ret);err:	if (ret != NULL)		BIO_free(ret);	return(NULL);		}