1FREE(3P) POSIX Programmer's Manual FREE(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 free - free allocated memory
13
15 #include <stdlib.h>
16
17 void free(void *ptr);
18
19
21 The free() function shall cause the space pointed to by ptr to be deal‐
22 located; that is, made available for further allocation. If ptr is a
23 null pointer, no action shall occur. Otherwise, if the argument does
24 not match a pointer earlier returned by the calloc(), malloc(),
25 posix_memalign(), realloc(), or strdup() function, or if the space
26 has been deallocated by a call to free() or realloc(), the behavior is
27 undefined.
28
29 Any use of a pointer that refers to freed space results in undefined
30 behavior.
31
33 The free() function shall not return a value.
34
36 No errors are defined.
37
38 The following sections are informative.
39
41 None.
42
44 There is now no requirement for the implementation to support the
45 inclusion of <malloc.h>.
46
48 None.
49
51 None.
52
54 calloc(), malloc(), realloc(), the Base Definitions volume of
55 IEEE Std 1003.1-2001, <stdlib.h>
56
58 Portions of this text are reprinted and reproduced in electronic form
59 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
60 -- Portable Operating System Interface (POSIX), The Open Group Base
61 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
62 Electrical and Electronics Engineers, Inc and The Open Group. In the
63 event of any discrepancy between this version and the original IEEE and
64 The Open Group Standard, the original IEEE and The Open Group Standard
65 is the referee document. The original Standard can be obtained online
66 at http://www.opengroup.org/unix/online.html .
67
68
69
70IEEE/The Open Group 2003 FREE(3P)