mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
perf timechart: Fix memory leaks in draw_wakeups()
The second loop for per_pidcommd is meaningful only when it doesn't have from and to tasks. Also make sure c->Y is set before copying the comm string otherwise it will be overwritten by next one. Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
parent
96a463ee62
commit
fcc9159fc8
|
|
@ -1110,12 +1110,12 @@ static void draw_wakeups(struct timechart *tchart)
|
|||
c = c->next;
|
||||
}
|
||||
c = p->all;
|
||||
while (c) {
|
||||
if (p->pid == we->waker && !from) {
|
||||
while (c && (!from || !to)) {
|
||||
if (c->Y && p->pid == we->waker && !from) {
|
||||
from = c->Y;
|
||||
task_from = strdup(c->comm);
|
||||
}
|
||||
if (p->pid == we->wakee && !to) {
|
||||
if (c->Y && p->pid == we->wakee && !to) {
|
||||
to = c->Y;
|
||||
task_to = strdup(c->comm);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user