Skip to content

Commit f64743e

Browse files
committed
C++: Fix mistake in example for cpp/incorrect-allocation-error-handling.
1 parent 3ae4cb2 commit f64743e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/ql/src/Security/CWE/CWE-570/IncorrectAllocationErrorHandling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void good1(std::size_t length) noexcept {
3434

3535
// GOOD: the allocation failure is handled appropriately.
3636
void good2(std::size_t length) noexcept {
37-
int* dest = new int[length];
37+
int* dest = new(std::nothrow) int[length];
3838
if(!dest) {
3939
return;
4040
}

0 commit comments

Comments
 (0)