summaryrefslogtreecommitdiffstats
path: root/crypto/evp/cmeth_lib.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2016-02-08 10:11:56 -0500
committerRich Salz <rsalz@openssl.org>2016-02-08 11:09:16 -0500
commit43ecb9c35caed8623cfd83e7d893b8b67725feb7 (patch)
tree676696126afa484d7afeba51771fdc8d41cc04ab /crypto/evp/cmeth_lib.c
parent4500a4cd4d89ba338ad796d39ccb9d94794cc0d7 (diff)
GH641: Don't care openssl_zmalloc
Don't cast malloc-family return values. Also found some places where (a) blank line was missing; and (b) the *wrong* return value was checked. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/evp/cmeth_lib.c')
-rw-r--r--crypto/evp/cmeth_lib.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/evp/cmeth_lib.c b/crypto/evp/cmeth_lib.c
index 1e7cac8157..33944e1894 100644
--- a/crypto/evp/cmeth_lib.c
+++ b/crypto/evp/cmeth_lib.c
@@ -64,7 +64,8 @@
EVP_CIPHER *EVP_CIPHER_meth_new(int cipher_type, int block_size, int key_len)
{
- EVP_CIPHER *cipher = (EVP_CIPHER *)OPENSSL_zalloc(sizeof(EVP_CIPHER));
+ EVP_CIPHER *cipher = OPENSSL_zalloc(sizeof(EVP_CIPHER));
+
if (cipher != NULL) {
cipher->nid = cipher_type;
cipher->block_size = block_size;
@@ -77,7 +78,8 @@ EVP_CIPHER *EVP_CIPHER_meth_dup(const EVP_CIPHER *cipher)
{
EVP_CIPHER *to = EVP_CIPHER_meth_new(cipher->nid, cipher->block_size,
cipher->key_len);
- if (cipher != NULL)
+
+ if (to != NULL)
memcpy(to, cipher, sizeof(*to));
return to;
}