OCSP Free

Free the OCSP request when creating the response only if there is an error making the request.
This commit is contained in:
John Safranek
2018-08-01 15:26:31 -07:00
parent 0ccdefb8d0
commit c87d6b27e2

View File

@@ -14048,8 +14048,10 @@ int CreateOcspResponse(WOLFSSL* ssl, OcspRequest** ocspRequest,
der->length); der->length);
} }
if (request != NULL) if (request != NULL && ret != 0) {
XFREE(request, ssl->heap, DYNAMIC_TYPE_OCSP_REQUEST); XFREE(request, ssl->heap, DYNAMIC_TYPE_OCSP_REQUEST);
request = NULL;
}
#ifdef WOLFSSL_SMALL_STACK #ifdef WOLFSSL_SMALL_STACK
XFREE(cert, ssl->heap, DYNAMIC_TYPE_DCERT); XFREE(cert, ssl->heap, DYNAMIC_TYPE_DCERT);
#endif #endif