Skip to content

Commit c6f41bc

Browse files
julek-wolfssldgarske
authored andcommitted
Fix memory leak on hash failure in LoadCertByIssuer
F-721
1 parent 4596e9e commit c6f41bc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/internal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14957,6 +14957,7 @@ int LoadCertByIssuer(WOLFSSL_X509_STORE* store, X509_NAME* issuer, int type)
1495714957
#elif !defined(NO_SHA)
1495814958
retHash = wc_ShaHash((const byte*)pbuf, (word32)len, dgt);
1495914959
#endif
14960+
wolfSSL_OPENSSL_free(pbuf);
1496014961
if (retHash == 0) {
1496114962
/* 4 bytes in little endian as unsigned long */
1496214963
hash = (((unsigned long)dgt[3] << 24) |
@@ -14967,7 +14968,6 @@ int LoadCertByIssuer(WOLFSSL_X509_STORE* store, X509_NAME* issuer, int type)
1496714968
WOLFSSL_MSG("failed hash operation");
1496814969
return WOLFSSL_FAILURE;
1496914970
}
14970-
wolfSSL_OPENSSL_free(pbuf);
1497114971
}
1497214972

1497314973
/* try to load each hashed name file in path */

0 commit comments

Comments
 (0)