Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9793 )

Change subject: tests: make both Valgrind and LeakSanitizer happy
......................................................................

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
---
M tests/ecu/ecu_fr_test.c
M tests/io/pq_file_test.c
M tests/io/pq_rtp_test.c
M tests/procqueue/pq_test.c
4 files changed, 12 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



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 @@
        /* 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 @@
        /* 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 @@
        /* 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 @@
        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;
 }

--
To view, visit https://gerrit.osmocom.org/9793
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gapk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia660d2fdac720f685c0186720d0a476d7e9468be
Gerrit-Change-Number: 9793
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>

Reply via email to