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:
fc67297
)
perf sort: Fix a memory leak on srcline
author
Namhyung Kim
<
[email protected]
>
Wed, 11 Sep 2013 05:09:25 +0000
(14:09 +0900)
committer
Arnaldo Carvalho de Melo
<
[email protected]
>
Wed, 9 Oct 2013 18:58:07 +0000
(15:58 -0300)
In the hist_entry__srcline_snprintf(), path and self->srcline are
pointing the same memory region, but they are doubly allocated.
Signed-off-by: Namhyung Kim <
[email protected]
>
Reviewed-by: Jiri Olsa <
[email protected]
>
Cc: Ingo Molnar <
[email protected]
>
Cc: Jiri Olsa <
[email protected]
>
Cc: Paul Mackerras <
[email protected]
>
Cc: Peter Zijlstra <
[email protected]
>
Link:
http://lkml.kernel.org/r/
[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <
[email protected]
>
tools/perf/util/sort.c
patch
|
blob
|
history
diff --git
a/tools/perf/util/sort.c
b/tools/perf/util/sort.c
index b4ecc0e4c908da0fe698849198b50963e6ef558a..97cf3ef4417c6496e5516cdd0e4e86891add4173 100644
(file)
--- a/
tools/perf/util/sort.c
+++ b/
tools/perf/util/sort.c
@@
-269,10
+269,7
@@
static int hist_entry__srcline_snprintf(struct hist_entry *self, char *bf,
if (!fp)
goto out_ip;
- if (getline(&path, &line_len, fp) < 0 || !line_len)
- goto out_ip;
- self->srcline = strdup(path);
- if (self->srcline == NULL)
+ if (getline(&self->srcline, &line_len, fp) < 0 || !line_len)
goto out_ip;
nl = strchr(self->srcline, '\n');