diff options
author | Randall Spangler <rspangler@chromium.org> | 2014-12-01 15:06:53 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-12-03 21:29:22 +0000 |
commit | 45562fb05a63e5f5a373d38e068a7e1100c92e7e (patch) | |
tree | 2d7caaf8fc9ee33c2bd91e51669d358fcb316ad2 /tests/vb2_host_key_tests.c | |
parent | 42a850059ca07f5e14fdf31990a35ad63e3f1bd8 (diff) | |
download | vboot-45562fb05a63e5f5a373d38e068a7e1100c92e7e.tar.gz |
vboot2: Use calloc() in host lib and unit tests
This is cleaner than malloc() immediately followed by memset().
BUG=chromium:423882
BRANCH=none
TEST=VBOOT2=1 make runtests
Change-Id: Iac32ca54ba18ef6722c6e9c58d521d5337a816b2
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/232770
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'tests/vb2_host_key_tests.c')
-rw-r--r-- | tests/vb2_host_key_tests.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/vb2_host_key_tests.c b/tests/vb2_host_key_tests.c index 5780691a..451366f7 100644 --- a/tests/vb2_host_key_tests.c +++ b/tests/vb2_host_key_tests.c @@ -187,8 +187,7 @@ static void public_key_tests(const struct alg_combo *combo, vb2_public_key_free(key); bufsize = vb2_packed_key_size(combo->sig_alg); - buf = malloc(bufsize); - memset(buf, 0, bufsize); + buf = calloc(1, bufsize); vb2_write_file(testfile, buf, bufsize - 1); TEST_EQ(vb2_public_key_read_keyb(&key, testfile), |