[PATCH 6/7] trace-cmd: Fix memory leak in stop_mapping_vcpus()

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

 



In stop_mapping_vcpus(), tmap.vcpu is allocated in map_kvm_vcpus() but
not freed in the error path.

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

diff --git a/tracecmd/trace-tsync.c b/tracecmd/trace-tsync.c
index 57baff39..834b4da4 100644
--- a/tracecmd/trace-tsync.c
+++ b/tracecmd/trace-tsync.c
@@ -258,6 +258,7 @@ static void stop_mapping_vcpus(int cpu_count, struct trace_guest *guest)
  out_free:
 	tep_free(tep);
  out:
+	free(tmap.vcpu);
 	free(tmap.map);
 	tracefs_instance_destroy(guest->instance);
 	tracefs_instance_free(guest->instance);
-- 
2.47.0





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

  Powered by Linux