diff options
| author | Michael Kerrisk <mtk.manpages@gmail.com> | 2008-04-05 04:59:18 +0000 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2008-04-05 04:59:18 +0000 |
| commit | fdc6b83141c42db927276aca75f40c49dd19c689 (patch) | |
| tree | 7177eb1b35f8a04e60fbbbd32ad6c2f79a4b1849 /man3/malloc.3 | |
| parent | 0000daa58e025e5d9018da1e52c19f67720245a4 (diff) | |
| download | man-pages-fdc6b83141c42db927276aca75f40c49dd19c689.tar.gz | |
RETURN VALUE: Note circumstances in which successful malloc() and
calloc() can return NULL.
Diffstat (limited to 'man3/malloc.3')
| -rw-r--r-- | man3/malloc.3 | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/man3/malloc.3 b/man3/malloc.3 index 104cbd12a4..6550f228b0 100644 --- a/man3/malloc.3 +++ b/man3/malloc.3 @@ -25,7 +25,7 @@ .\" Documented MALLOC_CHECK_, Wolfram Gloger (wmglo@dent.med.uni-muenchen.de) .\" 2007-09-15 mtk: added notes on malloc()'s use of sbrk() and mmap(). .\" -.TH MALLOC 3 2008-02-22 "GNU" "Linux Programmer's Manual" +.TH MALLOC 3 2008-04-05 "GNU" "Linux Programmer's Manual" .SH NAME calloc, malloc, free, realloc \- Allocate and free dynamic memory .SH SYNOPSIS @@ -124,8 +124,21 @@ For .BR calloc () and .BR malloc (), -the value returned is a pointer to the allocated memory, which is suitably -aligned for any kind of variable, or NULL if the request fails. +return a pointer to the allocated memory, which is suitably +aligned for any kind of variable. +On error, these functions return NULL. +NULL may also be returned by a successful call to +.BR malloc () +with a +.I size +of zero, +or by a successful call to +.BR realloc () +with +.I nmemb +or +.I size +equal to zero. .PP .BR free () returns no value. |
