set pointers to NULL after freeing memory

I even ran "make distcheck" this time.  I noticed a few permission
errors, but I don't worry about those because
Windows ACLs often take control of your files.