Do the success checkout out front

This commit is contained in:
kaleb-himes
2023-10-05 17:05:36 -06:00
parent 4bb6c51d2d
commit e51399ca0f

View File

@ -782,7 +782,7 @@ int wolfSSL_CertManagerVerify(WOLFSSL_CERT_MANAGER* cm, const char* fname,
#ifndef WOLFSSL_SMALL_STACK
byte staticBuffer[FILE_BUFFER_SIZE];
#endif
byte* buff;
byte* buff = NULL;
long sz = 0;
XFILE file = XBADFILE;
@ -814,16 +814,15 @@ int wolfSSL_CertManagerVerify(WOLFSSL_CERT_MANAGER* cm, const char* fname,
* small. */
#ifndef WOLFSSL_SMALL_STACK
if ((ret == WOLFSSL_SUCCESS) && (sz > (long)sizeof(staticBuffer)))
#else
if (ret == WOLFSSL_SUCCESS)
#endif
{
WOLFSSL_MSG("Getting dynamic buffer");
buff = (byte*)XMALLOC((size_t)sz, cm->heap, DYNAMIC_TYPE_FILE);
if (buff == NULL) {
/* If some other error has already occurred preserve that code
* return WOLFSSL_BAD_FILE if that is the only error condition */
if (ret == WOLFSSL_SUCCESS) {
ret = WOLFSSL_BAD_FILE;
}
ret = WOLFSSL_BAD_FILE;
}
}
/* Read all the file into buffer. */