% freeing NULL memory location in main().

My guess is that the pointers to dynamically allocated memory were not initially set to NULL. So the if(pointer != NULL) would return true even if the pointer didn't point to anything known. The pointer could be pointing to some arbitary place in memory and still try to delete memory.
This make Windows crash the program due to a segmentation fault error.

This should be fixed now.