summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-11-02 12:08:51 -0500
committerNick Mathewson <nickm@torproject.org>2014-11-02 12:08:51 -0500
commita142fc29aff4b47640a1a4f59032e25b7360e847 (patch)
tree2ed0562c0d55a35cb7cfbc7b34d0498f57c38496
parent1b93195a8109bcafe543d71c4f49c92087ccc17f (diff)
downloadtor-a142fc29aff4b47640a1a4f59032e25b7360e847.tar.gz
tor-a142fc29aff4b47640a1a4f59032e25b7360e847.zip
Use tor_malloc_zero(x), not tor_calloc(x,sizeof(char))
(Also, fixes a wide line.)
-rw-r--r--src/common/util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 77102837db..27cc9df878 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -3465,8 +3465,9 @@ format_win_cmdline_argument(const char *arg)
smartlist_add(arg_chars, (void*)&backslash);
/* Allocate space for argument, quotes (if needed), and terminator */
- formatted_arg = tor_calloc((smartlist_len(arg_chars) + (need_quotes ? 2 : 0) + 1),
- sizeof(char));
+ const size_t formatted_arg_len = smartlist_len(arg_chars) +
+ (need_quotes ? 2 : 0) + 1;
+ formatted_arg = tor_malloc_zero(formatted_arg_len);
/* Add leading quote */
i=0;