diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-25 20:28:51 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-25 20:28:51 +0000 |
commit | 5e1459a8e0de5f557ec4791c59f2061b7becf9d1 (patch) | |
tree | 20bdf2790791966831cb26d2ef0d235a33e96910 /lib/libcrypto/x509/x509_vfy.c | |
parent | 7999a18c62e4257df0056bc9103e6f2c6e5cbfca (diff) |
calloc instead of malloc/memset. from Benjamin Baier
Diffstat (limited to 'lib/libcrypto/x509/x509_vfy.c')
-rw-r--r-- | lib/libcrypto/x509/x509_vfy.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libcrypto/x509/x509_vfy.c b/lib/libcrypto/x509/x509_vfy.c index 0024904c20b..7da415f27c5 100644 --- a/lib/libcrypto/x509/x509_vfy.c +++ b/lib/libcrypto/x509/x509_vfy.c @@ -1950,12 +1950,11 @@ X509_STORE_CTX_new(void) { X509_STORE_CTX *ctx; - ctx = (X509_STORE_CTX *)malloc(sizeof(X509_STORE_CTX)); + ctx = calloc(1, sizeof(X509_STORE_CTX)); if (!ctx) { X509err(X509_F_X509_STORE_CTX_NEW, ERR_R_MALLOC_FAILURE); return NULL; } - memset(ctx, 0, sizeof(X509_STORE_CTX)); return ctx; } |