]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Remove needless check for a buffer that could not be NULL.
authorNick Mathewson <nickm@torproject.org>
Wed, 18 Apr 2012 14:38:39 +0000 (10:38 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 18 Apr 2012 14:38:39 +0000 (10:38 -0400)
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.

src/common/crypto.c

index dd85d147192ee3d9c2b8e52d250cd74572c18e09..e37b282757a6c8d1937f807c5fd6e21928a6302d 100644 (file)
@@ -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;
 }