aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/openssl/ssl/bio_ssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/ssl/bio_ssl.c')
-rw-r--r--crypto/openssl/ssl/bio_ssl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/openssl/ssl/bio_ssl.c b/crypto/openssl/ssl/bio_ssl.c
index 420deb7fc966..f0a031c71d6b 100644
--- a/crypto/openssl/ssl/bio_ssl.c
+++ b/crypto/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;