Segmentation Fault: new char[12]
Mike Albaugh
albaugh@agames.com
Wed Dec 8 10:35:00 GMT 1999
atharaken@my-deja.com wrote:
: Any free tools to detect memory leaks!!! Purify and Insure both cost a
: lot. Any others!
I don't think the "memory leak" is your biggest problem. The
visible result of a memory leak is that malloc() returns 0 after some
amount of time, but your code checks for that. Getting a _SEGFAULT_
from malloc() (or free(), or whatever) is almost always caused by
your application corrupting the malloc "headers" that are often
stored adjacent to the allocated memory. You need to be looking for
array-bounds violations, not memory-leaks.
Mike
| albaugh@agames.com, speaking only for myself
More information about the Gcc-help
mailing list