Use safer sizeof variant in malloc
[openssl.git] / crypto / asn1 / bio_ndef.c
index de517f22e40d5ea12f5f44dac326a804ebe78b86..ff2fdf529b26404d6bb01699121304082df7ca3b 100644 (file)
@@ -106,7 +106,7 @@ BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it)
         ASN1err(ASN1_F_BIO_NEW_NDEF, ASN1_R_STREAMING_NOT_SUPPORTED);
         return NULL;
     }
-    ndef_aux = OPENSSL_malloc(sizeof(NDEF_SUPPORT));
+    ndef_aux = OPENSSL_malloc(sizeof(*ndef_aux));
     asn_bio = BIO_new(BIO_f_asn1());
 
     /* ASN1 bio needs to be next to output BIO */