home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!emba-news.uvm.edu!griffin!ertle
- From: ertle@kira.uvm.edu The Sneaky Devil
- Subject: Re: Btree, or Linked List Questions
- Message-ID: <ertle.727827257@griffin>
- Sender: news@uvm.edu
- Organization: University of Vermont -- Division of EMBA Computer Facility
- References: <C13soz.73L@murphy.com> <1993Jan21.015358.24137@g2syd.genasys.com.au> <1993Jan23.182957.25180@scorch.apana.org.au>
- Distribution: default
- Date: Sat, 23 Jan 1993 22:14:17 GMT
- Lines: 21
-
- In <1993Jan23.182957.25180@scorch.apana.org.au> harris@scorch.apana.org.au (Michael Brown) writes:
-
-
- > for(;(temp_ptr=head_ptr)!=NULL;free(temp_ptr)) head_ptr=head_ptr->next;
- >
-
- This looks bogus to me. temp_ptr points to what head_ptr points to.
- Then you free what temp_ptr points to, leaving it and head_ptr
- pointing at nothing. Then you try to access what head_ptr points at.
-
- Your "C" package/operating system might not use the freed memory
- immediately, so this might work, but I don't think that you can count
- on it being portable.
-
-
-
- --
- James A. Ertle |Don't be such a guppy!!
- ertle@{hal|sal|kira|griffin}.uvm.edu |
- UVM's EMBA Computer Facility | -Ariel
- Burlington, Vt. USA |
-