Use safer sizeof variant in malloc
[openssl.git] / crypto / asn1 / ameth_lib.c
index 49f4e5abbff1a961504d74223dd10c3c65a5fc9c..c7acb468a653af56c1844254ff630d60a9f6c287 100644 (file)
@@ -284,7 +284,7 @@ EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags,
                                         const char *pem_str, const char *info)
 {
     EVP_PKEY_ASN1_METHOD *ameth;
-    ameth = OPENSSL_malloc(sizeof(EVP_PKEY_ASN1_METHOD));
+    ameth = OPENSSL_malloc(sizeof(*ameth));
     if (!ameth)
         return NULL;