Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!wuarchive!wugate!uunet!virtech!cpcahil From: cpcahil@virtech.UUCP (Conor P. Cahill) Newsgroups: comp.lang.c Subject: Re: What happens when realloc() returns NULL? Message-ID: <1103@virtech.UUCP> Date: 31 Aug 89 16:42:35 GMT References: Organization: Virtual Technologies Inc Lines: 20 In article , tom@yang.cpac.washington.edu (Tom May) writes: > and malloc() returns non-NULL, but realloc() returns NULL, is the memory > pointed to by p1 still allocated? This is yet another one of those RTFMs. The malloc page (under the DIAGNOSTICS section) clearly states the following: System V Rel 3.x: When realloc returns NULL, the block pointed to by & ptr is left intact. SCO Xenix 2.3.2 System V Rel 2.x: When this happens the block pointed to by ptr may be destroyed. -- +-----------------------------------------------------------------------+ | Conor P. Cahill uunet!virtech!cpcahil 703-430-9247 ! | Virtual Technologies Inc., P. O. Box 876, Sterling, VA 22170 | +-----------------------------------------------------------------------+