free

Frees a previously allocated memory block.

Library:LibC
Classification:ANSI
Service:Memory Management

Syntax

  #include <stdlib.h> 
   
  void free (
     void   *ptr);
  

Parameters

ptr

(IN) Points to a memory block previously allocated by a call to calloc, malloc, or realloc.

Remarks

When the value of ptr is NULL, the free function does nothing; otherwise, the free function deallocates the memory block located by the ptr parameter.

After a call to free, the freed memory block is available for allocation.

See Also