linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] trace-cmd library: Fix memory leaks of followers
@ 2023-06-07  1:27 Steven Rostedt
  0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2023-06-07  1:27 UTC (permalink / raw)
  To: Linux Trace Devel

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 --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);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-07  1:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-07  1:27 [PATCH] trace-cmd library: Fix memory leaks of followers Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).