File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
cpp/ql/src/experimental/Security/CWE/CWE-476 Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 11...
22try {
33 if (checkValue) throw exception ();
4- valData-> bufMyData = new myData*[valData-> sizeInt ];
4+ bufMyData = new myData*[sizeInt];
55
66 }
77 catch (...)
88 {
9- for (size_t i = 0 ; i < valData-> sizeInt ; i++)
9+ for (size_t i = 0 ; i < sizeInt; i++)
1010 {
11- delete[] valData-> bufMyData [i]->buffer ; // BAD
12- delete valData-> bufMyData [i];
11+ delete[] bufMyData[i]->buffer ; // BAD
12+ delete bufMyData[i];
1313 }
1414...
1515try {
1616 if (checkValue) throw exception ();
17- valData-> bufMyData = new myData*[valData-> sizeInt ];
17+ bufMyData = new myData*[sizeInt];
1818
1919 }
2020 catch (...)
2121 {
22- for (size_t i = 0 ; i < valData-> sizeInt ; i++)
22+ for (size_t i = 0 ; i < sizeInt; i++)
2323 {
24- if (valData-> bufMyData [i])
24+ if (bufMyData[i])
2525 {
26- delete[] valData-> bufMyData [i]->buffer ; // GOOD
27- delete valData-> bufMyData [i];
26+ delete[] bufMyData[i]->buffer ; // GOOD
27+ delete bufMyData[i];
2828 }
2929 }
3030
You can’t perform that action at this time.
0 commit comments