Hi gcc team, The following code creates orphaned memory by ignoring the return value of new:
#include<iostream>
using namespace std;
int main ( void ) {
for (int i=0; i< 10000000; i++)
new int[10000000];
int a;
cin >> a;
return 0;
}
Should g++ report a compile-time warning for this case?
root@quant:/tmp# g++ -Wall -Wextra MemoryLeakCheckCompilerWarning.cpp
-o MemoryLeakCheckCompilerWarning.exe
root@quant:/tmp#
Warm regards,
-S
