Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!swrinde!ucsd!hub.ucsb.edu!6600m00n From: 6600m00n@ucsbuxa.ucsb.edu (Jihad 'R US) Newsgroups: comp.os.msdos.programmer Subject: Re: malloc() and free() is order important Message-ID: <6456@hub.ucsb.edu> Date: 5 Oct 90 03:11:54 GMT References: <20681@orstcs.CS.ORST.EDU> Sender: news@hub.ucsb.edu Reply-To: 6600m00n@ucsbuxa.ucsb.edu Distribution: na Organization: Ghostwheel Redevelopment Agency Lines: 12 In-reply-to: duvalj@bionette.cgrb.orst.edu's message of 1 Oct 90 21:26:25 GMT Your problem is this: // your line data1 = (element *) malloc(LINEDELTA * sizeof(element *)); // the line as is should be. data1 = (element *) malloc(LINEDELTA * sizeof(element)); // you need the size of the item you are using. otherwise, can you // say "trashed memory ????" Hope this helps rob (6600m00n@ucsbuxa.ucsbuxa)