aboutsummaryrefslogtreecommitdiff
path: root/crypto/dh/dh_pmeth.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-03-24 07:52:24 -0400
committerRich Salz <rsalz@openssl.org>2015-03-24 07:52:24 -0400
commit0dfb9398bb6493d5a56216e0c7039cb3f9fc88c6 (patch)
tree9ffaa0bec3d0f14092948174eeea90dc8e2ee7c4 /crypto/dh/dh_pmeth.c
parent7c82e339a677f8546e1456c7a8f6788598a9de43 (diff)
downloadopenssl-0dfb9398bb6493d5a56216e0c7039cb3f9fc88c6.zip
openssl-0dfb9398bb6493d5a56216e0c7039cb3f9fc88c6.tar.gz
openssl-0dfb9398bb6493d5a56216e0c7039cb3f9fc88c6.tar.bz2
free NULL cleanup
Start ensuring all OpenSSL "free" routines allow NULL, and remove any if check before calling them. This gets ASN1_OBJECT_free and ASN1_STRING_free. Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto/dh/dh_pmeth.c')
-rw-r--r--crypto/dh/dh_pmeth.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/dh/dh_pmeth.c b/crypto/dh/dh_pmeth.c
index 8975f44..668f5f3 100644
--- a/crypto/dh/dh_pmeth.c
+++ b/crypto/dh/dh_pmeth.c
@@ -155,8 +155,7 @@ static void pkey_dh_cleanup(EVP_PKEY_CTX *ctx)
if (dctx) {
if (dctx->kdf_ukm)
OPENSSL_free(dctx->kdf_ukm);
- if (dctx->kdf_oid)
- ASN1_OBJECT_free(dctx->kdf_oid);
+ ASN1_OBJECT_free(dctx->kdf_oid);
OPENSSL_free(dctx);
}
}
@@ -245,8 +244,7 @@ static int pkey_dh_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
return dctx->kdf_ukmlen;
case EVP_PKEY_CTRL_DH_KDF_OID:
- if (dctx->kdf_oid)
- ASN1_OBJECT_free(dctx->kdf_oid);
+ ASN1_OBJECT_free(dctx->kdf_oid);
dctx->kdf_oid = p2;
return 1;