diff options
author | Rich Salz <rsalz@openssl.org> | 2015-05-01 14:37:16 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-01 14:37:16 -0400 |
commit | 25aaa98aa249d26391c1994d2de449562c8b8b99 (patch) | |
tree | 6f83efd87fa9fd832e8a456e9686143a29f1dab3 /ssl/ssl_rsa.c | |
parent | 666964780a245c14e8f0eb6e13dd854a37387ea9 (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 'ssl/ssl_rsa.c')
-rw-r--r-- | ssl/ssl_rsa.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/ssl/ssl_rsa.c b/ssl/ssl_rsa.c index e4798e9316..305b185a4c 100644 --- a/ssl/ssl_rsa.c +++ b/ssl/ssl_rsa.c @@ -212,12 +212,10 @@ static int ssl_set_pkey(CERT *c, EVP_PKEY *pkey) } } - if (c->pkeys[i].privatekey != NULL) - EVP_PKEY_free(c->pkeys[i].privatekey); + EVP_PKEY_free(c->pkeys[i].privatekey); CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY); c->pkeys[i].privatekey = pkey; c->key = &(c->pkeys[i]); - c->valid = 0; return (1); } @@ -715,8 +713,7 @@ int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file) } end: - if (x != NULL) - X509_free(x); + X509_free(x); BIO_free(in); return (ret); } |