What does “double free” mean?
问题 As the title suggests I am new to C and have a mid-term coming up shortly. I am revising from past papers currently and a recurring theme is double free problem. I understand that it is the process of calling free() on the same memory location twice, but I have a couple of questions that I'm not 100% sure how to answer: Question 1: What is the result of a double free in C, and why is it such a problem? This will cause a double free: char* ptr = malloc(sizeof(char)); *ptr = 'a'; free(ptr);