aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-08-13 10:36:06 -0400
committerNick Mathewson <nickm@torproject.org>2014-08-13 10:39:56 -0400
commit2bfd92d0d170642fb12f53e5da208f318fdd632c (patch)
tree09da23f22e58e196fef9995e21b59aff3b555487 /src/test
parent5da821a8a3cfffc18f5a656852d98e69cff5dd8f (diff)
downloadtor-2bfd92d0d170642fb12f53e5da208f318fdd632c.tar.gz
tor-2bfd92d0d170642fb12f53e5da208f318fdd632c.zip
Apply coccinelle script to replace malloc(a*b)->calloc(a,b)
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_pt.c2
-rw-r--r--src/test/test_util.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test_pt.c b/src/test/test_pt.c
index f71627df1e..f55c059580 100644
--- a/src/test/test_pt.c
+++ b/src/test/test_pt.c
@@ -194,7 +194,7 @@ test_pt_protocol(void)
managed_proxy_t *mp = tor_malloc_zero(sizeof(managed_proxy_t));
mp->conf_state = PT_PROTO_LAUNCHED;
mp->transports = smartlist_new();
- mp->argv = tor_malloc_zero(sizeof(char*)*2);
+ mp->argv = tor_calloc(sizeof(char *), 2);
mp->argv[0] = tor_strdup("<testcase>");
/* various wrong protocol runs: */
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 3f840cdfc2..c32fadd119 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -1487,7 +1487,7 @@ test_util_gzip(void)
/* Check whether we can uncompress concatenated, compressed strings. */
tor_free(buf3);
- buf2 = tor_realloc(buf2, len1*2);
+ buf2 = tor_reallocarray(buf2, len1, 2);
memcpy(buf2+len1, buf2, len1);
test_assert(!tor_gzip_uncompress(&buf3, &len2, buf2, len1*2,
ZLIB_METHOD, 1, LOG_INFO));