aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/ocsp/ocsp_cl.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/ocsp/ocsp_cl.c')
-rwxr-xr-xcrypto/ocsp/ocsp_cl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/ocsp/ocsp_cl.c b/crypto/ocsp/ocsp_cl.c
index b3612c8dfc79..fca7db0b71d6 100755
--- a/crypto/ocsp/ocsp_cl.c
+++ b/crypto/ocsp/ocsp_cl.c
@@ -93,8 +93,10 @@ OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid)
if (one->reqCert)
OCSP_CERTID_free(one->reqCert);
one->reqCert = cid;
- if (req && !sk_OCSP_ONEREQ_push(req->tbsRequest->requestList, one))
+ if (req && !sk_OCSP_ONEREQ_push(req->tbsRequest->requestList, one)) {
+ one->reqCert = NULL; /* do not free on error */
goto err;
+ }
return one;
err:
OCSP_ONEREQ_free(one);