From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <45643264451dadf7b26404d52daa17a5@plan9.bell-labs.com> From: "Russ Cox" To: 9fans@cse.psu.edu Subject: Re: [9fans] manual suggestions and upas/fs bug MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Tue, 17 Sep 2002 09:28:59 -0400 Topicbox-Message-UUID: ed26c166-eaca-11e9-9e20-41e7f4b1d025 > p = realloc(p,n) is almost always a mistake. If the allocation > fails, the previous pointer value in p gets replaced by a null > pointer value, so you lose the handle to the data that did not > get extended (or, rarely, shrunk). maybe this is what lucio was getting at, but when the next line is if(p == 0) sysfatal("out of memory"); then it doesn't really matter that we've lost the old p.