• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
malloc complaining that the objects must have been modified after being freed :-/
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: Re: black
  • Next by Date: Opening Files in Doc-based App
  • Previous by thread: Comparing file paths
  • Next by thread: Opening Files in Doc-based App
  • Index(es):
    • Date
    • Thread