diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-08-13 10:36:06 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-08-13 10:39:56 -0400 |
commit | 2bfd92d0d170642fb12f53e5da208f318fdd632c (patch) | |
tree | 09da23f22e58e196fef9995e21b59aff3b555487 /src/common/crypto.c | |
parent | 5da821a8a3cfffc18f5a656852d98e69cff5dd8f (diff) | |
download | tor-2bfd92d0d170642fb12f53e5da208f318fdd632c.tar.gz tor-2bfd92d0d170642fb12f53e5da208f318fdd632c.zip |
Apply coccinelle script to replace malloc(a*b)->calloc(a,b)
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r-- | src/common/crypto.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index 16292455b5..014c83e850 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -1838,7 +1838,7 @@ crypto_store_dynamic_dh_modulus(const char *fname) goto done; } - base64_encoded_dh = tor_malloc_zero(len * 2); /* should be enough */ + base64_encoded_dh = tor_calloc(len, 2); /* should be enough */ new_len = base64_encode(base64_encoded_dh, len * 2, (char *)dh_string_repr, len); if (new_len < 0) { @@ -3164,7 +3164,7 @@ setup_openssl_threading(void) int i; int n = CRYPTO_num_locks(); n_openssl_mutexes_ = n; - openssl_mutexes_ = tor_malloc(n*sizeof(tor_mutex_t *)); + openssl_mutexes_ = tor_calloc(n, sizeof(tor_mutex_t *)); for (i=0; i < n; ++i) openssl_mutexes_[i] = tor_mutex_new(); CRYPTO_set_locking_callback(openssl_locking_cb_); |