Normally, if a pointer is freed twice, it\'s a double free. For example,
char *ptr; ptr=malloc(5 * sizeof(*ptr)); free(ptr); free(ptr);
The
Yes this is a double free (and a very bad thing to do). The ptr1 is a pointer to the memory allocated by the malloc. It is the same location that ptr was pointing to. By freeing ptr and ptr1 you are freeing the same memory twice.