TODO talloc/testsuite: fix memory leak in test_rusty()
authorStefan Metzmacher <metze@samba.org>
Mon, 4 Apr 2011 13:58:02 +0000 (15:58 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 17 May 2018 08:15:18 +0000 (10:15 +0200)
Is this a bug or feature?

Also print subunit messages and don't call
talloc_enable_null_tracking(), that's already done by test_reset().

metze

lib/talloc/testsuite.c

index 12298a78ecc98efaf227b6ae381373ac61197ecc..0776f20b1f934eed45060ef3f6ea028f7e9f3f09 100644 (file)
@@ -1540,15 +1540,19 @@ static bool test_free_ref_null_context(void)
 static bool test_rusty(void)
 {
        void *root;
-       const char *p1;
+       char *p1;
+
+       printf("test: rusty \n# TALLOC RUSTY\n");
 
-       talloc_enable_null_tracking();
        root = talloc_new(NULL);
        p1 = talloc_strdup(root, "foo");
        talloc_increase_ref_count(p1);
        talloc_report_full(root, stdout);
        talloc_free(root);
        CHECK_BLOCKS("null_context", NULL, 2);
+       talloc_free(p1);
+
+       printf("success: rusty\n");
        return true;
 }