🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Error Message

Started by
0 comments, last by Checksum 22 years, 9 months ago
Has anyone ever experienced the error *Z_Free: Memory Block wrote past end*? Thanks in advance, {CS}
Advertisement
When you delete''d or free()''d an object, it detected that you wrote past the end of it, perhaps you have code like this:

  char mystring[] = "Hello World";char *buffer = new char[strlen(mystring)];strcpy( buffer, mystring );  


Your call to new[strlen(mystring)] didn''t allocate space for the trailing null that gets added to the end of the string, so when you delete[] that array, you''ll get an error like the one you described.

codeka.com - Just click it.

This topic is closed to new replies.

Advertisement