mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
trace_kprobes: Fix memory leak
tp->nr_args is not set before we "goto error", it causes memory leak for free_trace_probe() use tp->nr_args to free memory of args. Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Acked-by: Masami Hiramatsu <mhiramat@redhat.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <4B0CEB95.2060107@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
0f1ef51d24
commit
abab9d37d2
1 changed files with 3 additions and 1 deletions
|
@ -704,10 +704,12 @@ static int create_trace_probe(int argc, char **argv)
|
|||
ret = parse_probe_arg(arg, &tp->args[i].fetch, is_return);
|
||||
if (ret) {
|
||||
pr_info("Parse error at argument%d. (%d)\n", i, ret);
|
||||
kfree(tp->args[i].name);
|
||||
goto error;
|
||||
}
|
||||
|
||||
tp->nr_args++;
|
||||
}
|
||||
tp->nr_args = i;
|
||||
|
||||
ret = register_trace_probe(tp);
|
||||
if (ret)
|
||||
|
|
Loading…
Reference in a new issue