1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-01 03:26:58 +03:00

replace new by new (std::nothrow), remove arduino_new

This commit is contained in:
david gauchard
2020-08-17 18:15:45 +02:00
parent 5b3d290de8
commit 6925982284
45 changed files with 207 additions and 167 deletions

View File

@ -50,9 +50,13 @@ CertStore::CertInfo CertStore::_preprocessCert(uint32_t length, uint32_t offset,
memset(&ci, 0, sizeof(ci));
// Process it using SHA256, same as the hashed_dn
br_x509_decoder_context *ctx = new br_x509_decoder_context;
br_sha256_context *sha256 = new br_sha256_context;
br_x509_decoder_context *ctx = new (std::nothrow) br_x509_decoder_context;
br_sha256_context *sha256 = new (std::nothrow) br_sha256_context;
if (!ctx || !sha256) {
if (ctx)
delete ctx;
if (sha256)
delete sha256;
DEBUG_BSSL("CertStore::_preprocessCert: OOM\n");
return ci;
}
@ -202,7 +206,7 @@ const br_x509_trust_anchor *CertStore::findHashedTA(void *ctx, void *hashed_dn,
return nullptr;
}
data.close();
cs->_x509 = new X509List(der, ci.length);
cs->_x509 = new (std::nothrow) X509List(der, ci.length);
free(der);
if (!cs->_x509) {
DEBUG_BSSL("CertStore::findHashedTA: OOM\n");