diff options
author | Rich Salz <rsalz@openssl.org> | 2015-03-28 10:54:15 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-03-28 10:54:15 -0400 |
commit | c5ba2d990420e1778ca4a90bf882e0f806404af0 (patch) | |
tree | 61641d19bea624b7fa523162f0ebb0d5e2fccf55 /apps/genpkey.c | |
parent | 33b188a8e82df57208ec8263c263f8b6f47e8255 (diff) | |
download | openssl-c5ba2d990420e1778ca4a90bf882e0f806404af0.tar.gz |
free NULL cleanup
EVP_.*free; this gets:
EVP_CIPHER_CTX_free EVP_PKEY_CTX_free EVP_PKEY_asn1_free
EVP_PKEY_asn1_set_free EVP_PKEY_free EVP_PKEY_free_it
EVP_PKEY_meth_free; and also EVP_CIPHER_CTX_cleanup
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Diffstat (limited to 'apps/genpkey.c')
-rw-r--r-- | apps/genpkey.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/apps/genpkey.c b/apps/genpkey.c index 5b7f4335b1..bd81d51a22 100644 --- a/apps/genpkey.c +++ b/apps/genpkey.c @@ -268,10 +268,8 @@ int MAIN(int argc, char **argv) ret = 0; end: - if (pkey) - EVP_PKEY_free(pkey); - if (ctx) - EVP_PKEY_CTX_free(ctx); + EVP_PKEY_free(pkey); + EVP_PKEY_CTX_free(ctx); BIO_free_all(out); BIO_free(in); if (pass) @@ -317,10 +315,8 @@ static int init_keygen_file(BIO *err, EVP_PKEY_CTX **pctx, err: BIO_puts(err, "Error initializing context\n"); ERR_print_errors(err); - if (ctx) - EVP_PKEY_CTX_free(ctx); - if (pkey) - EVP_PKEY_free(pkey); + EVP_PKEY_CTX_free(ctx); + EVP_PKEY_free(pkey); return 0; } @@ -375,8 +371,7 @@ int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx, err: BIO_printf(err, "Error initializing %s context\n", algname); ERR_print_errors(err); - if (ctx) - EVP_PKEY_CTX_free(ctx); + EVP_PKEY_CTX_free(ctx); return 0; } |