Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!udel!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Deleting linked lists. Message-ID: <15600@smoke.brl.mil> Date: 27 Mar 91 21:31:12 GMT References: <2636@borg.cs.unc.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 12 In article <2636@borg.cs.unc.edu> warner@weiss.cs.unc.edu (Byron Warner) writes: > free(ptr); > ptr = ptr->next; >I am not sure if I can assume that >the value of ptr will not be corrupted >after it is freed. It's not ptr, but rather the region of storage to which ptr points, that can be clobbered by the call to free(). Indeed I made this mistake once (in an early release of my dirent implementation). I knew better, I just forgot.