Skip to contentSkip to conversation

libtraceevent: Free line in tep_parse_kallsyms()

PATCH New Steven Rostedt 1 participant 1 message Apr 12, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtraceevent: Free line in tep_parse_kallsyms()

From: "Steven Rostedt (VMware)" <[email protected]>

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

---
 src/event-parse.c | 1 +
 1 file changed, 1 insertion(+)
src/event-parse.c +1 -0
index cec4ad1..8d1ac65 100644
@@ -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);
Signature · 1 line
2.29.2