Sun Studio 12: Debugging a Program With dbx

Bad Free (baf) Error

Problem: Attempt to free memory that has never been allocated.

Possible causes: Passing a non-heap data pointer to free() or realloc().

Example:

char a[4];
char *b = &a[0];

free(b);                    /* Bad free (baf) */