Article View: comp.std.c
Article #2195realloc() unable to allocate
From: Phil Howard
Date: Fri, 02 Oct 1992 21:26
Date: Fri, 02 Oct 1992 21:26
17 lines
910 bytes
910 bytes
If realloc() is unable to allocate the larger space desired, what happens?
7.10.3.4 says:
"... If the space cannot be allocated, the object pointed to by ptr
is unchanged. ..."
and
"The realloc function returns either a null pointer or a pointer to the
possible moved allocated space".
While it SEEMS apparent that the meaning is that if realloc() cannot allocate
more space, it would return the NULL pointer (and to reuse the original object,
the pointer to it must be retained by the caller), I don't see any literal
statement to that effect. Is there a concensus?
Technical Details
Message-ID:
<BvIJJz.BpD@ux1.cso.uiuc.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!caen!uwm.edu!ux1.cso.uiuc.edu!philShow Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!sparky!uunet!caen!uwm.edu!ux1.cso.uiuc.edu!phil From: phil@ux1.cso.uiuc.edu (Phil Howard) Subject: realloc() unable to allocate Message-ID: <BvIJJz.BpD@ux1.cso.uiuc.edu> Organization: University of Illinois at Urbana Date: Fri, 2 Oct 1992 21:26:08 GMT Lines: 17