summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authortrhodes <trhodes@FreeBSD.org>2002-12-20 01:01:24 +0000
committertrhodes <trhodes@FreeBSD.org>2002-12-20 01:01:24 +0000
commit71621c649c41e6dea0f80644e4e51f370ebcab8c (patch)
tree793f19b01d150117d5192c80f4ee96b8880ff6a0 /lib/libc
parent93c339304633b5ad378709d555b7c1ee41c842c0 (diff)
downloadFreeBSD-src-71621c649c41e6dea0f80644e4e51f370ebcab8c.zip
FreeBSD-src-71621c649c41e6dea0f80644e4e51f370ebcab8c.tar.gz
Document what really occurs when we obtain an error.
PR: 43357 Submitted by: David Schultz <dschultz@uclink.Berkeley.EDU>
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdlib/malloc.315
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/libc/stdlib/malloc.3 b/lib/libc/stdlib/malloc.3
index 8fa0326..b6084d6 100644
--- a/lib/libc/stdlib/malloc.3
+++ b/lib/libc/stdlib/malloc.3
@@ -304,14 +304,17 @@ functions return a pointer, possibly identical to
to the allocated memory
if successful; otherwise a
.Dv NULL
-pointer is returned, in which case the
-memory referenced by
-.Fa ptr
-is still available and intact.
-In the case of memory allocation failure,
+pointer is returned, and
.Va errno
is set to
-.Er ENOMEM .
+.Er ENOMEM
+if the error was the result of an allocation failure.
+The
+.Fn realloc
+function always leaves the original buffer intact
+when an error occurs, whereas
+.Fn reallocf
+deallocates it in this case.
.Pp
The
.Fn free
OpenPOWER on IntegriCloud