Fix -4 return code when expected BAD_FUNC_ARG(-173)

This commit is contained in:
kaleb-himes
2023-10-05 14:20:37 -06:00
parent 2c4556c797
commit 4bb6c51d2d

View File

@@ -819,7 +819,11 @@ int wolfSSL_CertManagerVerify(WOLFSSL_CERT_MANAGER* cm, const char* fname,
WOLFSSL_MSG("Getting dynamic buffer");
buff = (byte*)XMALLOC((size_t)sz, cm->heap, DYNAMIC_TYPE_FILE);
if (buff == NULL) {
ret = WOLFSSL_BAD_FILE;
/* 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;
}
}
}
/* Read all the file into buffer. */