summaryrefslogtreecommitdiff
path: root/src/common/crypto.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r--src/common/crypto.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index dd85d14719..e37b282757 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -1051,10 +1051,9 @@ crypto_pk_public_hybrid_encrypt(crypto_pk_t *env,
tor_assert(outlen+symlen < INT_MAX);
return (int)(outlen + symlen);
err:
- if (buf) {
- memset(buf, 0, pkeylen);
- tor_free(buf);
- }
+
+ memset(buf, 0, pkeylen);
+ tor_free(buf);
crypto_cipher_free(cipher);
return -1;
}