From: jsing Date: Sun, 14 Dec 2014 14:45:33 +0000 (+0000) Subject: Remove redundant NULL checks before free - BN_free(), BIO_free_all() and X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=631884860f9b7ffe97f4d0a99a17269610b1b19e;p=openbsd Remove redundant NULL checks before free - BN_free(), BIO_free_all() and EC_GROUP_free() all have implicit NULL checks. --- diff --git a/usr.bin/openssl/ecparam.c b/usr.bin/openssl/ecparam.c index 4b2119ee214..1441fa7d2ab 100644 --- a/usr.bin/openssl/ecparam.c +++ b/usr.bin/openssl/ecparam.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecparam.c,v 1.5 2014/12/07 14:58:50 jsing Exp $ */ +/* $OpenBSD: ecparam.c,v 1.6 2014/12/14 14:45:33 jsing Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -583,25 +583,20 @@ ecparam_main(int argc, char **argv) EC_KEY_free(eckey); } ret = 0; + end: - if (ec_p) - BN_free(ec_p); - if (ec_a) - BN_free(ec_a); - if (ec_b) - BN_free(ec_b); - if (ec_gen) - BN_free(ec_gen); - if (ec_order) - BN_free(ec_order); - if (ec_cofactor) - BN_free(ec_cofactor); + BN_free(ec_p); + BN_free(ec_a); + BN_free(ec_b); + BN_free(ec_gen); + BN_free(ec_order); + BN_free(ec_cofactor); + free(buffer); + BIO_free(in); - if (out != NULL) - BIO_free_all(out); - if (group != NULL) - EC_GROUP_free(group); + BIO_free_all(out); + EC_GROUP_free(group); return (ret); }