Use safer sizeof variant in malloc
[openssl.git] / crypto / evp / bio_enc.c
index 0afd8cc502dc5a641eeef32251d6c3f704f7cb05..86a2dc5743e68c1671f29f09b3c01d53881e2058 100644 (file)
@@ -112,7 +112,7 @@ static int enc_new(BIO *bi)
 {
     BIO_ENC_CTX *ctx;
 
-    ctx = OPENSSL_malloc(sizeof(BIO_ENC_CTX));
+    ctx = OPENSSL_malloc(sizeof(*ctx));
     if (ctx == NULL)
         return (0);
     EVP_CIPHER_CTX_init(&ctx->cipher);