I have been trying to free memory allocated via malloc() using free().
malloc()
free()
Some of the structs it does free but leaves some the way they were a
That check won't check if the variable is freed. Note that free(pointer) does not set that pointer to NULL. If you want that to be the case, you have to set it yourself, and it is a common idiom in C:
free(pointer)
free(pointer); pointer = NULL;
to signal that you already freed that pointer.