Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!van-bc!resrch!resrch.molienergy.bc.ca!jamesd From: jamesd@resrch.molienergy.bc.ca (James Dudley) Newsgroups: comp.sys.ibm.pc Subject: Freeing allociated memory. Message-ID: <1990Jan10.202458.17223@resrch.molienergy.bc.ca> Date: 10 Jan 90 20:24:58 GMT Sender: jamesd@resrch.molienergy.bc.ca (James Dudley) Distribution: na Organization: Moli Energy Ltd., Burnaby, B.C., CANADA Lines: 30 Hello to all: I am experiencing a problem with freeing memory allociated which was allociated with malloc(). Consider the following code. char *buf, *lineptr[2000]; if (buf = (char *) malloc(fsize*sizeof(char)) == NULL) { print error message and return } lineptr[0] = buf; do stuff /* now free allociated memory */ free((void *) buf); Free() doesnot appear to deallociate the memory because I am using a routine to traverse the Heap and report back Free and Unused blocks. Using MSC 5.1 compiled with Small memory model. Any ideas? Thanks in advance for any help on this. James -- James Dudley jamesd@MoliEnergy.BC.CA Moli Energy Ltd. ...!ubc-cs!van-bc!resrch!jamesd Burnaby, B.C. CANADA