summaryrefslogtreecommitdiffstats
path: root/apps/apps.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-05-01 14:37:16 -0400
committerRich Salz <rsalz@openssl.org>2015-05-01 14:37:16 -0400
commit25aaa98aa249d26391c1994d2de449562c8b8b99 (patch)
tree6f83efd87fa9fd832e8a456e9686143a29f1dab3 /apps/apps.c
parent666964780a245c14e8f0eb6e13dd854a37387ea9 (diff)
free NULL cleanup -- coda
After the finale, the "real" final part. :) Do a recursive grep with "-B1 -w [a-zA-Z0-9_]*_free" to see if any of the preceeding lines are an "if NULL" check that can be removed. Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'apps/apps.c')
-rw-r--r--apps/apps.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/apps/apps.c b/apps/apps.c
index f2a17a4633..1b76dbf825 100644
--- a/apps/apps.c
+++ b/apps/apps.c
@@ -592,12 +592,9 @@ int load_cert_crl_http(const char *url, X509 **pcert, X509_CRL **pcrl)
}
err:
- if (host)
- OPENSSL_free(host);
- if (path)
- OPENSSL_free(path);
- if (port)
- OPENSSL_free(port);
+ OPENSSL_free(host);
+ OPENSSL_free(path);
+ OPENSSL_free(port);
if (bio)
BIO_free_all(bio);
OCSP_REQ_CTX_free(rctx);
@@ -660,8 +657,7 @@ X509 *load_cert(const char *file, int format,
BIO_printf(bio_err, "unable to load certificate\n");
ERR_print_errors(bio_err);
}
- if (cert != NULL)
- BIO_free(cert);
+ BIO_free(cert);
return (x);
}
@@ -761,8 +757,7 @@ EVP_PKEY *load_key(const char *file, int format, int maybe_stdin,
goto end;
}
end:
- if (key != NULL)
- BIO_free(key);
+ BIO_free(key);
if (pkey == NULL) {
BIO_printf(bio_err, "unable to load %s\n", key_descrip);
ERR_print_errors(bio_err);
@@ -849,8 +844,7 @@ EVP_PKEY *load_pubkey(const char *file, int format, int maybe_stdin,
pkey = b2i_PublicKey_bio(key);
#endif
end:
- if (key != NULL)
- BIO_free(key);
+ BIO_free(key);
if (pkey == NULL)
BIO_printf(bio_err, "unable to load %s\n", key_descrip);
return (pkey);