diff mbox series

trace-cmd test: Close handle after opening

Message ID 20230607132710.4f642c78@gandalf.local.home (mailing list archive)
State Accepted
Commit 8ec026f0fa13f3d97343af20049d34da0405e58f
Headers show
Series trace-cmd test: Close handle after opening | expand

Commit Message

Steven Rostedt June 7, 2023, 5:27 p.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

The unit tests opens a handle via tracecmd_open() but fails to close it
causing the memory leak detector to trigger on it.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 utest/tracecmd-utest.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/utest/tracecmd-utest.c b/utest/tracecmd-utest.c
index 69dcb4be..34fed1e1 100644
--- a/utest/tracecmd-utest.c
+++ b/utest/tracecmd-utest.c
@@ -438,6 +438,8 @@  static void test_trace_library_read(void)
 	ret = tracecmd_iterate_events(handle, NULL, 0, read_events, &data);
 	CU_TEST(ret == 0);
 
+	tracecmd_close(handle);
+
 	CU_TEST(data.counter > 0);
 	trace_seq_destroy(&data.seq);
 }