Memory Allocation/Freeing Problems
I am creating a buffer for a simple compiler. Essential all this program
does is take chars that are taken from a .txt file and stores them into
memory. The 'buffer' is a char* and memory is allocated for it using malloc
and is also reallocated. The problem is is am trying to free the memory
used by this char* when exiting the program. I am using the following code
to free the memory:
free((void *) pBd->pcb_head);
pBd->pcb_head = NULL;
After I have done this the characters still reside in memory which messes up
the program when I try to execute it again. Anyone have any thoughts on
what I am doing wrong?