fix memory leak with format, meaning

check just before return at end of function
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.
Merge pull request #21 from rhmccullough/master

fix memory leak with format, meaning