From 5ec69e74aa00653b339f3f526529cd3c926c657a Mon Sep 17 00:00:00 2001 From: tedu <> Date: Wed, 9 Jul 2014 22:55:17 +0000 Subject: ASN1_STRING_free can handle NULL, so callers don't need to check. ok miod --- src/lib/libcrypto/dsa/dsa_ameth.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/lib/libcrypto/dsa/dsa_ameth.c') diff --git a/src/lib/libcrypto/dsa/dsa_ameth.c b/src/lib/libcrypto/dsa/dsa_ameth.c index c6707b9427..06b804b19d 100644 --- a/src/lib/libcrypto/dsa/dsa_ameth.c +++ b/src/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-55-g6feb