diff options
author | Rich Salz <rsalz@akamai.com> | 2015-05-01 22:06:07 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-02 07:54:03 -0400 |
commit | 53ba0a9e91ad203de2943edaf1090ab17ec435fa (patch) | |
tree | b9946c983ddaee7555baf5c42372a52f7d012428 | |
parent | 539ed89f686866b82a9ec9a4c3b112878d29cd73 (diff) |
RT3776: Wrong size for malloc
Use sizeof *foo parameter, to avoid these errors.
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
-rw-r--r-- | crypto/x509/x509_vpm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/x509/x509_vpm.c b/crypto/x509/x509_vpm.c index 29ee8a738f..6305406756 100644 --- a/crypto/x509/x509_vpm.c +++ b/crypto/x509/x509_vpm.c @@ -161,16 +161,16 @@ X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void) X509_VERIFY_PARAM *param; X509_VERIFY_PARAM_ID *paramid; - param = OPENSSL_malloc(sizeof(X509_VERIFY_PARAM)); + param = OPENSSL_malloc(sizeof *param); if (!param) return NULL; - paramid = OPENSSL_malloc(sizeof(X509_VERIFY_PARAM)); + paramid = OPENSSL_malloc(sizeof *paramid); if (!paramid) { OPENSSL_free(param); return NULL; } - memset(param, 0, sizeof(X509_VERIFY_PARAM)); - memset(paramid, 0, sizeof(X509_VERIFY_PARAM_ID)); + memset(param, 0, sizeof *paramid); + memset(paramid, 0, sizeof *paramid); param->id = paramid; x509_verify_param_zero(param); return param; |