mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-05 16:20:48 +02:00
Fix memory leak on hash failure in LoadCertByIssuer
F-721
This commit is contained in:
committed by
David Garske
parent
4596e9e1a7
commit
c6f41bce2f
+1
-1
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user