tests: sanitize: fix mem leaks, clean after tests
Fix various mem leaks in the testing code.
Add test_common_cleanup() in test_common.c, to free talloc contexts; call in
test-{helpers,hnbap,ranap}.c. Upon talloc ctx cleanup, ensure that they are
actually empty, in order to catch newly introduced mem leaks.
If non-empty, print talloc context reports.
Change-Id: Ic66c005f2a264774e18bb54e58b87bef5944511c
diff --git a/src/tests/test-ranap.c b/src/tests/test-ranap.c
index c1c7003..05be874 100644
--- a/src/tests/test-ranap.c
+++ b/src/tests/test-ranap.c
@@ -197,6 +197,8 @@
talloc_report(talloc_asn1_ctx, stdout);
talloc_report(tall_msgb_ctx, stdout);
//talloc_report(NULL, stdout);
+
+ test_common_cleanup();
printf("exit\n");
exit(0);
}