Use safer sizeof variant in malloc
[openssl.git] / crypto / x509v3 / v3_asid.c
index 34469eb7bace621e183804862549693aaee99012..d7f58486fb16e7b5587167e0344ca5886034c758 100644 (file)
@@ -471,7 +471,7 @@ static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice)
             ASRange *r;
             switch (a->type) {
             case ASIdOrRange_id:
-                if ((r = OPENSSL_malloc(sizeof(ASRange))) == NULL) {
+                if ((r = OPENSSL_malloc(sizeof(*r))) == NULL) {
                     X509V3err(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE,
                               ERR_R_MALLOC_FAILURE);
                     goto done;