[PATCH] libtraceevent: Free line in tep_parse_kallsyms()

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

 



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

The line used to read the /proc/kallsyms file is allocated, but is never
freed, resulting in a memory leak. Free it.

Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>
---
 src/event-parse.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/event-parse.c b/src/event-parse.c
index cec4ad1..8d1ac65 100644
--- a/src/event-parse.c
+++ b/src/event-parse.c
@@ -743,6 +743,7 @@ int tep_parse_kallsyms(struct tep_handle *tep, const char *kallsyms)
 
 		line = strtok_r(NULL, "\n", &next);
 	}
+	free(line);
 	ret = 0;
  out:
 	free(copy);
-- 
2.29.2




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

  Powered by Linux