Usually, if the pointer is freed twice, it is double free. For instance,
char *ptr; ptr=malloc(5 * sizeof(*ptr)); free(ptr); free(ptr);
The above code is considered double. Are the following, also considered double, free?
char *ptr; char *ptr1; ptr=malloc(5 * sizeof(*ptr)); ptr1=ptr; free(ptr); free(ptr1);
Thanks.
source share