malloc complaining that the objects must have been modified after being freed :-/
malloc complaining that the objects must have been modified after being freed :-/
- Subject: malloc complaining that the objects must have been modified after being freed :-/
- From: Alexandre Aybes <email@hidden>
- Date: Sun, 23 Dec 2001 00:13:15 +0100
Hi there,
I have a problem (Yet another one ;) with malloc... it doesn't
want to do what I need it to do... :/
I call the code below in the awakeFromNib method of my
controller and malloc when it's getting called, logs the
following line in the console:
*** malloc[5171]: error for object 0x22f4e40: Incorrect check
sum for freed object - object was probably modified after beeing
freed; break at szone_error
And here is the bogus code:
Triangles count is about 150 or so... so the toal size is around
18xx bytes...
int mallocBytes = sizeof(int) * trianglesCount * 3;
int* tmpTrianglesPtr;
tmpTrianglesPtr = (int*)malloc(mallocBytes);
I just don't get it... do I have to call something special
before calling malloc the first time?
Any help appreciated... :)
Alex.