summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-06-30 19:51:14 +0700
committerHarald Welte <laforge@gnumonks.org>2018-07-03 15:27:47 +0000
commit58c4bc68c81ede69d3fcdd7531760bdc1355b14f (patch)
tree5cc0d6becbdc172f9acccac3dd8870f110ee46bd
parentb29b9810922829bab4aefd3c888ccef683e8fc3d (diff)
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
-rw-r--r--tests/ecu/ecu_fr_test.c3
-rw-r--r--tests/io/pq_file_test.c3
-rw-r--r--tests/io/pq_rtp_test.c3
-rw-r--r--tests/procqueue/pq_test.c3
4 files changed, 12 insertions, 0 deletions
diff --git a/tests/ecu/ecu_fr_test.c b/tests/ecu/ecu_fr_test.c
index 372df25..609112f 100644
--- a/tests/ecu/ecu_fr_test.c
+++ b/tests/ecu/ecu_fr_test.c
@@ -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;
}
diff --git a/tests/io/pq_file_test.c b/tests/io/pq_file_test.c
index 6691db3..664acf7 100644
--- a/tests/io/pq_file_test.c
+++ b/tests/io/pq_file_test.c
@@ -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;
}
diff --git a/tests/io/pq_rtp_test.c b/tests/io/pq_rtp_test.c
index f4070b7..2c1bd41 100644
--- a/tests/io/pq_rtp_test.c
+++ b/tests/io/pq_rtp_test.c
@@ -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;
}
diff --git a/tests/procqueue/pq_test.c b/tests/procqueue/pq_test.c
index 198108d..84b3992 100644
--- a/tests/procqueue/pq_test.c
+++ b/tests/procqueue/pq_test.c
@@ -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;
}