neovim/neovim — pull request #321 by tarruda (2014-03-07 15:19:23+00:00)
Title: [WIP/RFC] Fix all vim memory leaks and properly fix valgrind checks

After #312, I got a little suspicious about the automatic valgrind validation and decided to investigate it more deeply.

After a looking into it, I concluded that the test target was ignoring valgrind checks for all tests except test1, due to the '-' in the $(RUN_VIM) call. The leading '-' causes make to ignore errors returned by valgrind. It also didnt include the proper --error-exitcode flag(although I already had fixed that). The EXITFREE definition in cmakelists.txt was also incorrect.

After fixing all the valgrind validation issues, the tests started to fail(so far only test49 had issues). To confirm that this wasn't a problem introduced by neovim, I also verified the same problem in the upstream version of vim.

This PR will fix all pending memory leaks, and improve valgrind coverage to improve travis detection of future memory leaks.