xref: /original-bsd/lib/libc/stdlib/free.3 (revision ba762ddc)
1.\" Copyright (c) 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)free.3	5.1 (Berkeley) 05/02/91
7.\"
8.Dd
9.Dt FREE 3
10.Os
11.Sh NAME
12.Nm free
13.Nd free up memory allocated with malloc, calloc or realloc
14.Sh SYNOPSIS
15.Fd #include <stdlib.h>
16.Ft void
17.Fn free "void *ptr"
18.Sh DESCRIPTION
19The
20.Fn free
21function causes the space pointed to by
22.Fa ptr
23to be deallocated, that is, made available
24for further allocation.
25If
26.Fa ptr
27is a null pointer, no action occurs.
28Otherwise, if the argument does not match a pointer earlier
29returned by the
30.Xr calloc ,
31.Xr malloc ,
32or
33.Xr realloc
34function, or if the space has been deallocated by a call to
35.Fn free
36or
37.Xr realloc ,
38general havoc may occur.
39.Sh RETURN VALUES
40The
41.Fn free
42function returns no value.
43.Sh SEE ALSO
44.Xr calloc 3 ,
45.Xr malloc 3 ,
46.Xr realloc 3
47.Sh STANDARDS
48The
49.Fn free
50function conforms to
51.St -ansiC .
52