#6 undefined C++ code

open
nobody
None
5
2010-05-18
2010-05-18
Darix
No

to quote https://bugzilla.novell.com/show_bug.cgi?id=445510:
[[[
I just checked some of the source code in the Suse Linux factory package
tse3-0.3.1-144.18 and I noticed the following

$ egrep "new |delete" ../BUILD/tse3-0.3.1/src/tse3/MidiFile.cpp | fgrepmtrks
mtrks = new unsigned char*[mfi->fileNoMTrks];
mtrksize = new size_t[mfi->fileNoMTrks];
mtrkstatus = new int[mfi->fileNoMTrks];
delete mtrks;
delete mtrksize;
delete mtrkstatus;

Suggest replace all three deletes with

delete [] mtrks; mtrks = NULL;
delete [] mtrksize; mtrksize = NULL;
delete [] mtrkstatus; mtrkstatus = NULL;
]]]

Discussion