tests: make both Valgrind and LeakSanitizer happy

The talloc_enable_null_tracking() actually allocates a new talloc
context, which makes both Valgrind and LeakSanitizer angry. This
context should be freed by the talloc_disable_null_tracking().

Change-Id: Ia660d2fdac720f685c0186720d0a476d7e9468be
This commit is contained in:
Vadim Yanitskiy 2018-06-30 19:51:14 +07:00 committed by Harald Welte
parent b29b981092
commit 58c4bc68c8
4 changed files with 12 additions and 0 deletions

View File

@ -143,5 +143,8 @@ int main(int argc, char **argv)
/* Make sure we have no memleaks */
talloc_report_depth_cb(NULL, 0, 10, &talloc_ctx_walk_cb, NULL);
/* Make both Valgrind and LeakSanitizer happy */
talloc_disable_null_tracking();
return 0;
}

View File

@ -145,5 +145,8 @@ int main(int argc, char **argv)
/* Print talloc memory hierarchy */
talloc_report_depth_cb(NULL, 0, 10, &talloc_ctx_walk_cb, NULL);
/* Make both Valgrind and LeakSanitizer happy */
talloc_disable_null_tracking();
return 0;
}

View File

@ -345,5 +345,8 @@ int main(int argc, char **argv)
/* Memory leak detection test */
talloc_report_depth_cb(NULL, 0, 10, &talloc_ctx_walk_cb, NULL);
/* Make both Valgrind and LeakSanitizer happy */
talloc_disable_null_tracking();
return 0;
}

View File

@ -369,5 +369,8 @@ int main(int argc, char **argv)
printf("Processing queue deallocation test:\n");
talloc_report_depth_cb(NULL, 0, 10, &talloc_ctx_walk_cb, NULL);
/* Make both Valgrind and LeakSanitizer happy */
talloc_disable_null_tracking();
return 0;
}