aboutsummaryrefslogtreecommitdiffstats
path: root/c/sha3.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/sha3.c')
-rw-r--r--c/sha3.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/c/sha3.c b/c/sha3.c
index 5bbfb1c..c460b5f 100644
--- a/c/sha3.c
+++ b/c/sha3.c
@@ -697,7 +697,7 @@ extern byte* sha3_digest(byte* restrict_ msg, long msglen, boolean withReturn)
#endif
free(M);
M = null;
- rc = (byte*)malloc(((n + 7) >> 3) * sizeof(byte));
+ rc = withReturn ? (byte*)malloc(((n + 7) >> 3) * sizeof(byte)) : null;
_msg = message;
nnn = len;