🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #2534

Re: malloc() and free() is order important

#2534
From: Jihad 'R US
Date: Fri, 05 Oct 1990 03:11
12 lines
930 bytes
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)
Technical Details
Message-ID: <6456@hub.ucsb.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!swrinde!ucsd!hub.ucsb.edu!6600m00n
References: <20681@orstcs.CS.ORST.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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