Skip to contentSkip to conversation

trace-cmd test: Close handle after opening

PATCH New Steven Rostedt 1 participant 1 message Jun 7, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace-cmd test: Close handle after opening

From: "Steven Rostedt (Google)" <[email protected]>

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

---
 utest/tracecmd-utest.c | 2 ++
 1 file changed, 2 insertions(+)
utest/tracecmd-utest.c +2 -0
index 69dcb4be..34fed1e1 100644
@@ -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);
 }
Signature · 1 line
2.35.1