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