Share

Scintilla

Tracker: Bugs

5 macosx/PlatMacOSX.cxx:1631:Mismatching alloc and dealloc - ID: 2671749
Last Update: Comment added ( nyamatongwe )

In file macosx/PlatMacOSX.cxx:1631 variable text is deallocated
incorrectly.

Memory is allocated like this:
char* text = new char[maximumByteLength];

And released like this:
delete text;

Deleting like that causes undefined behavior according to the C++ standard.
It should be released like this:

delete [] text;

This bug was found using Cppcheck: http://cppcheck.wiki.sourceforge.net/


Reijo Tomperi ( aggro80 ) - 2009-03-07 19:25

5

Closed

Fixed

Neil Hodgson

Scintilla

Bug

Public


Comments ( 2 )

Date: 2009-04-28 04:13
Sender: nyamatongweProject Admin

Fix released in 1.78


Date: 2009-03-08 09:23
Sender: nyamatongweProject Admin

Committed.


Attached File

No Files Currently Attached

Changes ( 5 )

Field Old Value Date By
status_id Open 2009-04-28 04:13 nyamatongwe
allow_comments 1 2009-04-28 04:13 nyamatongwe
close_date - 2009-04-28 04:13 nyamatongwe
resolution_id None 2009-03-08 09:23 nyamatongwe
assigned_to nobody 2009-03-08 09:23 nyamatongwe