diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-04-18 10:38:39 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-04-18 10:38:39 -0400 |
commit | 4db5a1e151a7aa69f2682854b021d1f9bb0f5caf (patch) | |
tree | aa6265222348047758c078e73500c593c88ca23c /src/common/crypto.c | |
parent | 0b1ec16058f51cfa68da845507d1c30110cfff52 (diff) | |
download | tor-4db5a1e151a7aa69f2682854b021d1f9bb0f5caf.tar.gz tor-4db5a1e151a7aa69f2682854b021d1f9bb0f5caf.zip |
Remove needless check for a buffer that could not be NULL.
Fixes coverity CID 508: coverity scan doesn't like checking a
variable for non-NULL after it has been definitely dereferenced.
This should take us back down to zero coverity issues.
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r-- | src/common/crypto.c | 7 |
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; } |