openchange/openchange — pull request #88 by kamenim (2014-09-08 04:28:35+00:00)
Title: Track and fix memory leaks

This pull request
- implements memory leaks report for openchange-testsuite tool
- fixes several memory leaks
- a bit of refactoring to use talloc_new() for local memory context allocation (make mem leaks report more useful)
- switch global TALLOC_CTXs used in unit tests to be allocated on autofree context

@jelmer you are right, autofree context is the way to go in unit tests. I was a bit worried that
this will prevent us from spotting memory leaks (since I haven't had much of experience with autofree),
but testing it shows it shows it should be OK. My only worry is not to free behind a memory allocated
in autofree context that is actually not meant to be "long living".

I haven't refactored all unit tests to use talloc_autofree_context() yet since it turned out to be a long
tedious process (i have started it thought). Instead, I have opted out for allocating per-testsuite global
context on autofree context, which solved the problem with tc_unchecked test cases quite nicely :)