man.bsd.lv manual page server

Manual Page Search Parameters

FREE(3) Library Functions Manual FREE(3)

freefree up memory allocated with malloc, calloc or realloc

#include <stdlib.h>

void
free(void *ptr);

The () function causes the space pointed to by ptr to be deallocated, that is, made available for further allocation. If ptr is a null pointer, no action occurs. Otherwise, if the argument does not match a pointer earlier returned by the calloc, malloc, or realloc function, or if the space has been deallocated by a call to free() or realloc, general havoc may occur.

The free() function returns no value.

calloc(3), malloc(3), realloc(3)

The free() function conforms to ANSI X3.159-1989 (“ANSI C89”).

4.4BSD-Lite2 June 4, 1993 FREE(3)