A few small bugs with BIO popping.
PR: 364
This commit is contained in:
parent
5cd48abf9f
commit
5d780babe3
@ -395,6 +395,8 @@ BIO *BIO_pop(BIO *b)
|
||||
if (b == NULL) return(NULL);
|
||||
ret=b->next_bio;
|
||||
|
||||
BIO_ctrl(b,BIO_CTRL_POP,0,NULL);
|
||||
|
||||
if (b->prev_bio != NULL)
|
||||
b->prev_bio->next_bio=b->next_bio;
|
||||
if (b->next_bio != NULL)
|
||||
@ -402,7 +404,6 @@ BIO *BIO_pop(BIO *b)
|
||||
|
||||
b->next_bio=NULL;
|
||||
b->prev_bio=NULL;
|
||||
BIO_ctrl(b,BIO_CTRL_POP,0,NULL);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
@ -403,6 +403,10 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
{
|
||||
BIO_free_all(ssl->wbio);
|
||||
}
|
||||
if (b->next_bio != NULL)
|
||||
{
|
||||
CRYPTO_add(&b->next_bio->references,1,CRYPTO_LOCK_BIO);
|
||||
}
|
||||
ssl->wbio=NULL;
|
||||
ssl->rbio=NULL;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user