diff options
author | Rich Salz <rsalz@openssl.org> | 2015-05-01 10:02:07 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-01 10:02:07 -0400 |
commit | b548a1f11c06ccdfa4f52a539912d22d77ee309e (patch) | |
tree | 37ff8792ddf09e4805aa3ba76b805923d3c52734 /ssl/ssl_conf.c | |
parent | 33fbca83dcd05b77f807fab205c4523b8cfe85b5 (diff) | |
download | openssl-b548a1f11c06ccdfa4f52a539912d22d77ee309e.tar.gz |
free null cleanup finale
Don't check for NULL before calling OPENSSL_free
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'ssl/ssl_conf.c')
-rw-r--r-- | ssl/ssl_conf.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/ssl/ssl_conf.c b/ssl/ssl_conf.c index 97b4fb9414..5a19a75dbf 100644 --- a/ssl/ssl_conf.c +++ b/ssl/ssl_conf.c @@ -380,8 +380,7 @@ static int cmd_Certificate(SSL_CONF_CTX *cctx, const char *value) } if (rv > 0 && c && cctx->flags & SSL_CONF_FLAG_REQUIRE_PRIVATE) { char **pfilename = &cctx->cert_filename[c->key - c->pkeys]; - if (*pfilename) - OPENSSL_free(*pfilename); + OPENSSL_free(*pfilename); *pfilename = BUF_strdup(value); if (!*pfilename) rv = 0; @@ -659,11 +658,9 @@ void SSL_CONF_CTX_free(SSL_CONF_CTX *cctx) if (cctx) { size_t i; for (i = 0; i < SSL_PKEY_NUM; i++) { - if (cctx->cert_filename[i]) - OPENSSL_free(cctx->cert_filename[i]); + OPENSSL_free(cctx->cert_filename[i]); } - if (cctx->prefix) - OPENSSL_free(cctx->prefix); + OPENSSL_free(cctx->prefix); OPENSSL_free(cctx); } } @@ -688,8 +685,7 @@ int SSL_CONF_CTX_set1_prefix(SSL_CONF_CTX *cctx, const char *pre) if (tmp == NULL) return 0; } - if (cctx->prefix) - OPENSSL_free(cctx->prefix); + OPENSSL_free(cctx->prefix); cctx->prefix = tmp; if (tmp) cctx->prefixlen = strlen(tmp); |