[PATCH v2 04/22] libtracefs: Free buf in clear_func_filter()

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

 



From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>

The buf variable was allocated via tracefs_instance_file_read() but must be
freed with free().

Fixes: 789e82d7 ("libtracefs: New API to reset ftrace instance")
Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
---
 src/tracefs-instance.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/tracefs-instance.c b/src/tracefs-instance.c
index c385a078ecec..2efcc75dfd98 100644
--- a/src/tracefs-instance.c
+++ b/src/tracefs-instance.c
@@ -1371,6 +1371,7 @@ static void clear_func_filter(struct tracefs_instance *instance, const char *fil
 		filter[len+1] = '\0';
 		tracefs_instance_file_append(instance, file, filter);
 	}
+	free(buf);
 }
 
 static void clear_func_filters(struct tracefs_instance *instance)
-- 
2.42.0





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

  Powered by Linux