diff mbox series

[2/7] trace-cmd lib: Prevent a memory leak in tracecmd_tsync_with_guest()

Message ID 20241205144439.127564-3-jmarchan@redhat.com (mailing list archive)
State Accepted
Commit d14d790a04500c2cb9ce44d0077d428dbd411297
Headers show
Series trace-cmd: Fix misc issues uncoverd by static analysis | expand

Commit Message

Jerome Marchand Dec. 5, 2024, 2:44 p.m. UTC
Free tsync->proto_name in tracecmd_tsync_with_guest() error path.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
---
 lib/trace-cmd/trace-timesync.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/lib/trace-cmd/trace-timesync.c b/lib/trace-cmd/trace-timesync.c
index 6ee4e643..94f31bcd 100644
--- a/lib/trace-cmd/trace-timesync.c
+++ b/lib/trace-cmd/trace-timesync.c
@@ -805,6 +805,7 @@  tracecmd_tsync_with_guest(unsigned long long trace_id, int loop_interval,
 		tracecmd_msg_handle_close(tsync->msg_handle);
 	else if (fd >= 0)
 		close(fd);
+	free(tsync->proto_name);
 	free(tsync);
 
 	return NULL;