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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Free tsync->proto_name in tracecmd_tsync_with_guest() error path.

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

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;
-- 
2.47.0





[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux