From a57699c1800cbef0cf07cffaf9eef7e921835d2b Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 9 Jul 2014 22:55:18 +0000 Subject: ASN1_STRING_free can handle NULL, so callers don't need to check. ok miod --- lib/libcrypto/dsa/dsa_ameth.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'lib/libcrypto/dsa') 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; } -- cgit v1.2.3