Adjust the verify_extra test recipe to its executable
[openssl.git] / ssl / bio_ssl.c
index 473b3ff51992fdd8bdef63d3028e66330655bff1..639b10556a30a257a961c927091dbbf12b8d2829 100644 (file)
@@ -101,14 +101,12 @@ BIO_METHOD *BIO_f_ssl(void)
 
 static int ssl_new(BIO *bi)
 {
-    BIO_SSL *bs;
+    BIO_SSL *bs = OPENSSL_zalloc(sizeof(*bs));
 
-    bs = (BIO_SSL *)OPENSSL_malloc(sizeof(BIO_SSL));
     if (bs == NULL) {
         BIOerr(BIO_F_SSL_NEW, ERR_R_MALLOC_FAILURE);
         return (0);
     }
-    memset(bs, 0, sizeof(BIO_SSL));
     bi->init = 0;
     bi->ptr = (char *)bs;
     bi->flags = 0;
@@ -130,8 +128,7 @@ static int ssl_free(BIO *a)
         a->init = 0;
         a->flags = 0;
     }
-    if (a->ptr != NULL)
-        OPENSSL_free(a->ptr);
+    OPENSSL_free(a->ptr);
     return (1);
 }