summaryrefslogtreecommitdiffstats
path: root/crypto/ocsp
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-05-01 16:02:07 +0200
committerRich Salz <rsalz@openssl.org>2015-05-01 16:02:07 +0200
commitb548a1f11c06ccdfa4f52a539912d22d77ee309e (patch)
tree37ff8792ddf09e4805aa3ba76b805923d3c52734 /crypto/ocsp
parentFix some typo's, silence warnings. (diff)
downloadopenssl-b548a1f11c06ccdfa4f52a539912d22d77ee309e.tar.xz
openssl-b548a1f11c06ccdfa4f52a539912d22d77ee309e.zip
free null cleanup finale
Don't check for NULL before calling OPENSSL_free Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/ocsp')
-rw-r--r--crypto/ocsp/ocsp_ext.c3
-rw-r--r--crypto/ocsp/ocsp_ht.c3
-rw-r--r--crypto/ocsp/ocsp_lib.c12
3 files changed, 6 insertions, 12 deletions
diff --git a/crypto/ocsp/ocsp_ext.c b/crypto/ocsp/ocsp_ext.c
index 520b55afc7..91eac9b1c0 100644
--- a/crypto/ocsp/ocsp_ext.c
+++ b/crypto/ocsp/ocsp_ext.c
@@ -326,8 +326,7 @@ static int ocsp_add1_nonce(STACK_OF(X509_EXTENSION) **exts,
goto err;
ret = 1;
err:
- if (os.data)
- OPENSSL_free(os.data);
+ OPENSSL_free(os.data);
return ret;
}
diff --git a/crypto/ocsp/ocsp_ht.c b/crypto/ocsp/ocsp_ht.c
index 266b43b00a..aa10c0345c 100644
--- a/crypto/ocsp/ocsp_ht.c
+++ b/crypto/ocsp/ocsp_ht.c
@@ -139,8 +139,7 @@ void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx)
if (!rctx)
return;
BIO_free(rctx->mem);
- if (rctx->iobuf)
- OPENSSL_free(rctx->iobuf);
+ OPENSSL_free(rctx->iobuf);
OPENSSL_free(rctx);
}
diff --git a/crypto/ocsp/ocsp_lib.c b/crypto/ocsp/ocsp_lib.c
index 34df9ac04e..ac64b65235 100644
--- a/crypto/ocsp/ocsp_lib.c
+++ b/crypto/ocsp/ocsp_lib.c
@@ -273,14 +273,10 @@ int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath,
OCSPerr(OCSP_F_OCSP_PARSE_URL, OCSP_R_ERROR_PARSING_URL);
err:
- if (buf)
- OPENSSL_free(buf);
- if (*ppath)
- OPENSSL_free(*ppath);
- if (*pport)
- OPENSSL_free(*pport);
- if (*phost)
- OPENSSL_free(*phost);
+ OPENSSL_free(buf);
+ OPENSSL_free(*ppath);
+ OPENSSL_free(*pport);
+ OPENSSL_free(*phost);
return 0;
}