Path: utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!samsung!emory!hubcap!grimlok From: grimlok@hubcap.clemson.edu (Mike Percy) Newsgroups: comp.lang.c Subject: Re: Turbo C 2.0 MaLfUnCtIoNiNg? Keywords: Turbo C 2.0 bug malloc Message-ID: <9769@hubcap.clemson.edu> Date: 20 Jul 90 14:18:14 GMT References: <1217@kubix.kub.nl> Organization: Clemson University, Clemson, SC Lines: 20 mad-2@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. Yo, Sounds like you've written memory via a NULL pointer. If you do a malloc() and malloc returns NULL, there was no memory. Sound like you did a malloc(), got a return of NULL, didn't bother to check it, and wrote through the NULL Pointer -- DS:0000 -- blasting across the low end of the segment. "How much char could a char star star if char star could star char?" Mike Percy grimlok@hubcap.clemson.edu ISD, Clemson University mspercy@clemson.BITNET (803)656-3780 mspercy@clemson.clemson.edu