diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2009-12-23 15:16:25 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-12-23 15:16:25 -0500 |
commit | aa1e3f9bd5b74e8427f931e5e7dcdda5096b3fd2 (patch) | |
tree | 430b9c46f0eb98f37eecc77296e6c6e1a8caa66a /trace-util.c | |
parent | c6c290b28c5bed57afe759eca681f490b4353b7e (diff) |
trace-cmd: Add final memory clean ups
Made the trace-cmd report free up all memory that it allocated.
Thanks to valgrind!
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'trace-util.c')
-rw-r--r-- | trace-util.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/trace-util.c b/trace-util.c index c3d89c6..d5be6ed 100644 --- a/trace-util.c +++ b/trace-util.c | |||
@@ -89,6 +89,7 @@ void parse_cmdlines(struct pevent *pevent, | |||
89 | sscanf(line, "%d %as", &pid, | 89 | sscanf(line, "%d %as", &pid, |
90 | (float *)(void *)&comm); /* workaround gcc warning */ | 90 | (float *)(void *)&comm); /* workaround gcc warning */ |
91 | pevent_register_comm(pevent, comm, pid); | 91 | pevent_register_comm(pevent, comm, pid); |
92 | free(comm); | ||
92 | line = strtok_r(NULL, "\n", &next); | 93 | line = strtok_r(NULL, "\n", &next); |
93 | } | 94 | } |
94 | } | 95 | } |
@@ -121,6 +122,8 @@ void parse_proc_kallsyms(struct pevent *pevent, | |||
121 | mod[strlen(mod) - 1] = 0; | 122 | mod[strlen(mod) - 1] = 0; |
122 | 123 | ||
123 | pevent_register_function(pevent, func, addr, mod); | 124 | pevent_register_function(pevent, func, addr, mod); |
125 | free(func); | ||
126 | free(mod); | ||
124 | 127 | ||
125 | line = strtok_r(NULL, "\n", &next); | 128 | line = strtok_r(NULL, "\n", &next); |
126 | } | 129 | } |