Add null settings after frees. Add .gitignore.

Set vars to NULL after free as is good practice. Add a .gitignore so I
don't have to keep accidentally adding the binary...