aboutsummaryrefslogtreecommitdiff
path: root/openssl/ssl/bio_ssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'openssl/ssl/bio_ssl.c')
-rw-r--r--openssl/ssl/bio_ssl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/openssl/ssl/bio_ssl.c b/openssl/ssl/bio_ssl.c
index af319af30..eedac8a3f 100644
--- a/openssl/ssl/bio_ssl.c
+++ b/openssl/ssl/bio_ssl.c
@@ -348,7 +348,11 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
break;
case BIO_C_SET_SSL:
if (ssl != NULL)
+ {
ssl_free(b);
+ if (!ssl_new(b))
+ return 0;
+ }
b->shutdown=(int)num;
ssl=(SSL *)ptr;
((BIO_SSL *)b->ptr)->ssl=ssl;