aboutsummaryrefslogtreecommitdiffstats
path: root/c/sha3.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-04-23 17:21:18 +0200
committerMattias Andrée <maandree@operamail.com>2014-04-23 17:21:18 +0200
commit15061d7e91d45bdfb42a9f39166dd30c5e47bcc4 (patch)
treec53121b1460b712b58fce67c105c53a355ad53ee /c/sha3.c
parentfix year duplication (diff)
downloadsha3sum-15061d7e91d45bdfb42a9f39166dd30c5e47bcc4.tar.gz
sha3sum-15061d7e91d45bdfb42a9f39166dd30c5e47bcc4.tar.bz2
sha3sum-15061d7e91d45bdfb42a9f39166dd30c5e47bcc4.tar.xz
fix memory leak
Signed-off-by: Mattias Andrée <maandree@operamail.com>
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;