diff options
author | Sanskriti Sharma <sansharm@redhat.com> | 2018-10-02 10:29:12 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-10-08 14:23:45 -0300 |
commit | 9c8a182e5a73e01afd11742a2ab887bf338fdafd (patch) | |
tree | a285192c81f8f7edd5ae20362e83e875c4b9dd95 /tools/power/x86/intel_pstate_tracer | |
parent | faedbf3fd19f2511a39397f76359e4cc6ee93072 (diff) |
perf tools: Free 'printk' string in parse_ftrace_printk()
parse_ftrace_printk() tokenizes and parses a line, calling strdup() each
iteration. Add code to free this temporary format string duplicate.
Fixes the following coverity complaints:
Error: RESOURCE_LEAK (CWE-772):
tools/perf/util/trace-event-parse.c:158: overwrite_var: Overwriting
"printk" in "printk = strdup(fmt + 1)" leaks the storage that "printk"
points to.
tools/perf/util/trace-event-parse.c:162: leaked_storage: Variable
"printk" going out of scope leaks the storage it points to.
Signed-off-by: Sanskriti Sharma <sansharm@redhat.com>
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Cc: Joe Lawrence <joe.lawrence@redhat.com>
Link: http://lkml.kernel.org/r/1538490554-8161-4-git-send-email-sansharm@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/power/x86/intel_pstate_tracer')
0 files changed, 0 insertions, 0 deletions