diff options
-rw-r--r-- | lib/libcrypto/asn1/a_bytes.c | 12 | ||||
-rw-r--r-- | lib/libcrypto/asn1/p5_pbe.c | 5 | ||||
-rw-r--r-- | lib/libcrypto/dh/dh_ameth.c | 11 | ||||
-rw-r--r-- | lib/libcrypto/dsa/dsa_ameth.c | 11 | ||||
-rw-r--r-- | lib/libcrypto/rsa/rsa_ameth.c | 5 |
5 files changed, 17 insertions, 27 deletions
diff --git a/lib/libcrypto/asn1/a_bytes.c b/lib/libcrypto/asn1/a_bytes.c index 5b669bf07ab..61910be5fe1 100644 --- a/lib/libcrypto/asn1/a_bytes.c +++ b/lib/libcrypto/asn1/a_bytes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_bytes.c,v 1.14 2014/06/12 15:49:27 deraadt Exp $ */ +/* $OpenBSD: a_bytes.c,v 1.15 2014/07/09 22:55:17 tedu Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -121,7 +121,7 @@ d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp, err: ASN1err(ASN1_F_D2I_ASN1_TYPE_BYTES, i); - if ((ret != NULL) && ((a == NULL) || (*a != ret))) + if (a == NULL || *a != ret) ASN1_STRING_free(ret); return (NULL); } @@ -230,7 +230,7 @@ d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, return (ret); err: - if ((ret != NULL) && ((a == NULL) || (*a != ret))) + if (a == NULL || *a != ret) ASN1_STRING_free(ret); ASN1err(ASN1_F_D2I_ASN1_BYTES, i); return (NULL); @@ -292,14 +292,12 @@ asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c) a->length = num; free(a->data); a->data = (unsigned char *)b.data; - if (os != NULL) - ASN1_STRING_free(os); + ASN1_STRING_free(os); return (1); err: ASN1err(ASN1_F_ASN1_COLLATE_PRIMITIVE, c->error); - if (os != NULL) - ASN1_STRING_free(os); + ASN1_STRING_free(os); free(b.data); return (0); } diff --git a/lib/libcrypto/asn1/p5_pbe.c b/lib/libcrypto/asn1/p5_pbe.c index 2b538caac3c..19a88c20f1a 100644 --- a/lib/libcrypto/asn1/p5_pbe.c +++ b/lib/libcrypto/asn1/p5_pbe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p5_pbe.c,v 1.13 2014/06/12 15:49:27 deraadt Exp $ */ +/* $OpenBSD: p5_pbe.c,v 1.14 2014/07/09 22:55:17 tedu Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -119,8 +119,7 @@ PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter, err: if (pbe != NULL) PBEPARAM_free(pbe); - if (pbe_str != NULL) - ASN1_STRING_free(pbe_str); + ASN1_STRING_free(pbe_str); return 0; } diff --git a/lib/libcrypto/dh/dh_ameth.c b/lib/libcrypto/dh/dh_ameth.c index 9e911c87794..21714bb7481 100644 --- a/lib/libcrypto/dh/dh_ameth.c +++ b/lib/libcrypto/dh/dh_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dh_ameth.c,v 1.9 2014/07/09 13:26:47 miod Exp $ */ +/* $OpenBSD: dh_ameth.c,v 1.10 2014/07/09 22:55:17 tedu Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -167,8 +167,7 @@ dh_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey) err: free(penc); - if (str) - ASN1_STRING_free(str); + ASN1_STRING_free(str); return 0; } @@ -271,10 +270,8 @@ dh_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) err: free(dp); - if (params != NULL) - ASN1_STRING_free(params); - if (prkey != NULL) - ASN1_INTEGER_free(prkey); + ASN1_STRING_free(params); + ASN1_INTEGER_free(prkey); return 0; } diff --git a/lib/libcrypto/dsa/dsa_ameth.c b/lib/libcrypto/dsa/dsa_ameth.c index c6707b94279..06b804b19d9 100644 --- a/lib/libcrypto/dsa/dsa_ameth.c +++ b/lib/libcrypto/dsa/dsa_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsa_ameth.c,v 1.9 2014/07/09 10:16:24 miod Exp $ */ +/* $OpenBSD: dsa_ameth.c,v 1.10 2014/07/09 22:55:17 tedu Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -164,8 +164,7 @@ dsa_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey) err: free(penc); - if (pval) - ASN1_STRING_free(pval); + ASN1_STRING_free(pval); return 0; } @@ -319,10 +318,8 @@ dsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) err: free(dp); - if (params != NULL) - ASN1_STRING_free(params); - if (prkey != NULL) - ASN1_INTEGER_free(prkey); + ASN1_STRING_free(params); + ASN1_INTEGER_free(prkey); return 0; } diff --git a/lib/libcrypto/rsa/rsa_ameth.c b/lib/libcrypto/rsa/rsa_ameth.c index 813c634f31b..679fe7b3188 100644 --- a/lib/libcrypto/rsa/rsa_ameth.c +++ b/lib/libcrypto/rsa/rsa_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_ameth.c,v 1.8 2014/07/09 19:51:38 jsing Exp $ */ +/* $OpenBSD: rsa_ameth.c,v 1.9 2014/07/09 22:55:17 tedu Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -625,8 +625,7 @@ err: X509_ALGOR_free(mgf1alg); if (pss) RSA_PSS_PARAMS_free(pss); - if (os1) - ASN1_STRING_free(os1); + ASN1_STRING_free(os1); return rv; } return 2; |