Fixed resource and memory leaks.

Fixed: log_location remained unclosed and fullpath memory has never
been freed.
Merge pull request #117 from livioso/master

Fixed resource and memory leaks.