Figure 6: A duplicate call to deallocate memory

/* To compile: CRTBNDC PGM(EXAMPLE6) */
#include 

int main (int argc, char *argv[])
{
  char *ptr = (char*)malloc(16);
  free(ptr);
  free(ptr);  /* duplicate deallocation */
  return 0;
}