mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Remove a couple redundant NULL-checks before crypto_cipher_free
Calling crypto_cipher_free(NULL) is always safe, since (by convention) all of our xyz_free() functions treat xyz_free(NULL) as a no-op. Flagged by coverity scan; fixes CID 508 and 509.
This commit is contained in:
parent
1da5223e89
commit
ab3197c059
@ -1055,7 +1055,7 @@ crypto_pk_public_hybrid_encrypt(crypto_pk_t *env,
|
||||
memset(buf, 0, pkeylen);
|
||||
tor_free(buf);
|
||||
}
|
||||
if (cipher) crypto_cipher_free(cipher);
|
||||
crypto_cipher_free(cipher);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1112,7 +1112,7 @@ crypto_pk_private_hybrid_decrypt(crypto_pk_t *env,
|
||||
err:
|
||||
memset(buf,0,pkeylen);
|
||||
tor_free(buf);
|
||||
if (cipher) crypto_cipher_free(cipher);
|
||||
crypto_cipher_free(cipher);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user