fix a memory leak when OCSP lookup fails
This commit is contained in:
parent
3b6ba7935d
commit
ac885c40f0
@ -298,8 +298,6 @@ int CyaSSL_OCSP_Lookup_Cert(CYASSL_OCSP* ocsp, DecodedCert* cert)
|
||||
result = ocsp->CBIOOcsp(ocsp->IOCB_OcspCtx, url, urlSz,
|
||||
ocspReqBuf, ocspReqSz, &ocspRespBuf);
|
||||
}
|
||||
else
|
||||
return OCSP_LOOKUP_FAIL;
|
||||
|
||||
if (result >= 0) {
|
||||
InitOcspResponse(&ocspResponse, certStatus, ocspRespBuf, result);
|
||||
@ -320,6 +318,10 @@ int CyaSSL_OCSP_Lookup_Cert(CYASSL_OCSP* ocsp, DecodedCert* cert)
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
result = OCSP_LOOKUP_FAIL;
|
||||
}
|
||||
|
||||
if (ocspReqBuf != NULL) {
|
||||
XFREE(ocspReqBuf, NULL, DYNAMIC_TYPE_IN_BUFFER);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user