mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
C++: Fix mistake in example for cpp/incorrect-allocation-error-handling.
This commit is contained in:
@@ -34,7 +34,7 @@ void good1(std::size_t length) noexcept {
|
||||
|
||||
// GOOD: the allocation failure is handled appropriately.
|
||||
void good2(std::size_t length) noexcept {
|
||||
int* dest = new int[length];
|
||||
int* dest = new(std::nothrow) int[length];
|
||||
if(!dest) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user