Turbo C 2.0 MaLfUnCtIoNiNg?

Tom Spengler spengler at lance.tis.llnl.gov
Sat Jul 21 03:50:15 AEST 1990


In article <1217 at kubix.kub.nl> mad-2 at kub.nl (C. Wekx) writes:
>
>Yo folks,
>
>
>	does anyone happen to know why Turbo C 2.0's malloc
>function is malfunctioning? They do not always signal an out of memory
>situation, but overwrite the first part of their segment instead.
>
>
>
>
>						Joris

On a couple of occasions, I was *sure* that some function in the malloc() 
family was misbehaving, but not so.  It was me, and the cause in each case was
a bogus free().  A free() on a wrong pointer will corrupt the free list.
The results of this corruption may not be immediately seen, but at some point,
the program will fail in puzzling, and usually catastrophic, ways on DOS.

So, check all pointers returned by malloc() and friends, and check all your
free()s.

Hope this helps.		--Tom Spengler (spengler at tis.llnl.gov)



More information about the Comp.lang.c mailing list