Menu

#957 jikes-1.22-138.13 : call to wrong C++ delete

open
nobody
None
5
2008-11-11
2008-11-11
Anonymous
No

Moved from https://bugzilla.novell.com/show_bug.cgi?id=443666

I just checked some of the source code in the Suse Linux Factory package jikes-1.22-138.13 and I noticed the following:

$ egrep "new|delete" ../BUILD/jikes-1.22/src/class.cpp | fgrep unicode_problem
wchar_t* unicode_problem = new wchar_t[length + 1];
delete unicode_problem;

The call to delete seems to be wrong.
Suggest new code

delete [] unicode_problem; unicode_problem = NULL;

Discussion


Log in to post a comment.