Fix memory leak on hash failure in LoadCertByIssuer

F-721
This commit is contained in:
Juliusz Sosinowicz
2026-03-16 14:55:07 +01:00
committed by David Garske
parent 4596e9e1a7
commit c6f41bce2f
+1 -1
View File
@@ -14957,6 +14957,7 @@ int LoadCertByIssuer(WOLFSSL_X509_STORE* store, X509_NAME* issuer, int type)
#elif !defined(NO_SHA)
retHash = wc_ShaHash((const byte*)pbuf, (word32)len, dgt);
#endif
wolfSSL_OPENSSL_free(pbuf);
if (retHash == 0) {
/* 4 bytes in little endian as unsigned long */
hash = (((unsigned long)dgt[3] << 24) |
@@ -14967,7 +14968,6 @@ int LoadCertByIssuer(WOLFSSL_X509_STORE* store, X509_NAME* issuer, int type)
WOLFSSL_MSG("failed hash operation");
return WOLFSSL_FAILURE;
}
wolfSSL_OPENSSL_free(pbuf);
}
/* try to load each hashed name file in path */