Use std::nothrow from <new> with every new allocation

This commit is contained in:
Rangi42
2024-03-07 09:56:15 -05:00
parent 104fd6c70d
commit e5b7e65e91
6 changed files with 4 additions and 3 deletions

View File

@@ -59,7 +59,7 @@ char const *macro_GetAllArgs() {
for (uint32_t i = macroArgs->shift; i < nbArgs; i++)
len += macroArgs->args[i].length() + 1; // 1 for comma
char *str = new char[len + 1]; // 1 for '\0'
char *str = new (std::nothrow) char[len + 1]; // 1 for '\0'
char *ptr = str;
if (!str)