This question was asked to me in an interview.
Suppose char *p=malloc(n) assigns more than n,say N bytes of memory are allocated and free(p) is used to free the memory a
Other answers have explained well how the block size is handled. To find out how much memory is freed, the only solution I can think of is to call mallinfo() before and after the free.
mallinfo()