avoid memory leak.
Using valgrind and OSX leaks command.