TOC | Prev | Next

free on something you didn't malloc

If you free something you didn't malloc, you crash.

This includes arrays. Basically, if you didn't malloc it don't
free it, especially if it's passed in to your function.

char name[] = "Bob";
char *p = &name;
free(p);
TOC | Prev | Next