mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
fix a memory leak when OCSP lookup fails
This commit is contained in:
@@ -298,8 +298,6 @@ int CyaSSL_OCSP_Lookup_Cert(CYASSL_OCSP* ocsp, DecodedCert* cert)
|
|||||||
result = ocsp->CBIOOcsp(ocsp->IOCB_OcspCtx, url, urlSz,
|
result = ocsp->CBIOOcsp(ocsp->IOCB_OcspCtx, url, urlSz,
|
||||||
ocspReqBuf, ocspReqSz, &ocspRespBuf);
|
ocspReqBuf, ocspReqSz, &ocspRespBuf);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
return OCSP_LOOKUP_FAIL;
|
|
||||||
|
|
||||||
if (result >= 0) {
|
if (result >= 0) {
|
||||||
InitOcspResponse(&ocspResponse, certStatus, ocspRespBuf, result);
|
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) {
|
if (ocspReqBuf != NULL) {
|
||||||
XFREE(ocspReqBuf, NULL, DYNAMIC_TYPE_IN_BUFFER);
|
XFREE(ocspReqBuf, NULL, DYNAMIC_TYPE_IN_BUFFER);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user