aboutsummaryrefslogtreecommitdiff
path: root/c/main.c
diff options
context:
space:
mode:
authorTheVice <[email protected]>2020-01-27 16:29:16 +0200
committerJack O'Connor <[email protected]>2020-01-27 16:17:09 -0500
commit4730ab237ec7442cdf99e2d36c975c25a0ce78d9 (patch)
treed1924c87455dcc0a80aaa3760b1415080c2f635b /c/main.c
parentdec0c4957689226919bcb09f426f2870c2b81f9e (diff)
[memset] placed function after checking of memory was done
on which it should be apply.
Diffstat (limited to 'c/main.c')
-rw-r--r--c/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/c/main.c b/c/main.c
index 9433937..eba8c03 100644
--- a/c/main.c
+++ b/c/main.c
@@ -143,11 +143,11 @@ int main(int argc, char **argv) {
/* TODO: An incremental output reader API to avoid this allocation. */
uint8_t *out = malloc(out_len);
- memset(out, 0, out_len);
if (out_len > 0 && out == NULL) {
fprintf(stderr, "malloc() failed.\n");
return 1;
}
+ memset(out, 0, out_len);
blake3_hasher_finalize(&hasher, out, out_len);
for (size_t i = 0; i < out_len; i++) {
printf("%02x", out[i]);