Example: free
The following example uses free to de-allocate a buffer of length 1024.
char * buf; if ((buf = (char *)calloc(1024, sizeof(char))) == NULL) { lr_output_message ("Insufficient memory available"); return -1; } lr_output_message ("Memory allocated. Buffer address = %.8x", buf);
// Do something with the buffer here ...
// Now free the buffer
free(buf);
Example: Output:
Action.c(11): Memory allocated. Buffer address = 007b9d88