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 /crypto/ocsp/ocsp_cl.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 'crypto/ocsp/ocsp_cl.c')
-rw-r--r-- | crypto/ocsp/ocsp_cl.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crypto/ocsp/ocsp_cl.c b/crypto/ocsp/ocsp_cl.c index 78d817db9e..0f3f13faf8 100644 --- a/crypto/ocsp/ocsp_cl.c +++ b/crypto/ocsp/ocsp_cl.c @@ -91,8 +91,7 @@ OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid) if (!(one = OCSP_ONEREQ_new())) goto err; - if (one->reqCert) - OCSP_CERTID_free(one->reqCert); + OCSP_CERTID_free(one->reqCert); one->reqCert = cid; if (req && !sk_OCSP_ONEREQ_push(req->tbsRequest->requestList, one)) goto err; @@ -107,6 +106,7 @@ OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid) int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm) { GENERAL_NAME *gen; + gen = GENERAL_NAME_new(); if (gen == NULL) return 0; @@ -115,8 +115,7 @@ int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm) return 0; } gen->type = GEN_DIRNAME; - if (req->tbsRequest->requestorName) - GENERAL_NAME_free(req->tbsRequest->requestorName); + GENERAL_NAME_free(req->tbsRequest->requestorName); req->tbsRequest->requestorName = gen; return 1; } |