projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ce49d84
)
perf tools: Cleanup trace-event-info 'tdata' leak
author
Sanskriti Sharma
<
[email protected]
>
Tue, 2 Oct 2018 14:29:11 +0000
(10:29 -0400)
committer
Arnaldo Carvalho de Melo
<
[email protected]
>
Mon, 8 Oct 2018 17:23:45 +0000
(14:23 -0300)
Free tracing_data structure in tracing_data_get() error paths.
Fixes the following coverity complaint:
Error: RESOURCE_LEAK (CWE-772):
leaked_storage: Variable "tdata" going out of scope leaks the storage
Signed-off-by: Sanskriti Sharma <
[email protected]
>
Reviewed-by: Jiri Olsa <
[email protected]
>
Cc: Joe Lawrence <
[email protected]
>
Link:
http://lkml.kernel.org/r/
[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <
[email protected]
>
tools/perf/util/trace-event-info.c
patch
|
blob
|
history
diff --git
a/tools/perf/util/trace-event-info.c
b/tools/perf/util/trace-event-info.c
index 7b0ca7cbb7de852433a2dbd7494789096b555edd..8ad8e755127bd704e991254ee735e1f0d6ab9ed3 100644
(file)
--- a/
tools/perf/util/trace-event-info.c
+++ b/
tools/perf/util/trace-event-info.c
@@
-531,12
+531,14
@@
struct tracing_data *tracing_data_get(struct list_head *pattrs,
"/tmp/perf-XXXXXX");
if (!mkstemp(tdata->temp_file)) {
pr_debug("Can't make temp file");
+ free(tdata);
return NULL;
}
temp_fd = open(tdata->temp_file, O_RDWR);
if (temp_fd < 0) {
pr_debug("Can't read '%s'", tdata->temp_file);
+ free(tdata);
return NULL;
}