diff mbox series

trace-cmd library: Fix memory leaks of followers

Message ID 20230606212750.1abd4a1d@gandalf.local.home (mailing list archive)
State Accepted
Commit 4c179a69860146bae2e412819e7040eaa3c40c2a
Headers show
Series trace-cmd library: Fix memory leaks of followers | expand

Commit Message

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

While running valgrind to test the new attach command, it discovered that
the follow strings in the handle were never freed. Free them.

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

Patch

diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index 865721ae50b6..145c02eeb718 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -4942,6 +4942,8 @@  void tracecmd_close(struct tracecmd_input *handle)
 	free(handle->trace_clock);
 	free(handle->strings);
 	free(handle->version);
+	free(handle->followers);
+	free(handle->missed_followers);
 	trace_guest_map_free(handle->map);
 	close(handle->fd);
 	free(handle->latz.chunks);