Skip to content

Commit

Permalink
perf kmem: Fix a memory leak
Browse files Browse the repository at this point in the history
The 'str' should be freed when sort_dimension__add() failed too.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1325957132-10600-5-git-send-email-namhyung@gmail.com
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Namhyung Kim authored and Arnaldo Carvalho de Melo committed Jan 8, 2012
1 parent 8442da1 commit 1b22859
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/perf/builtin-kmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ static int setup_sorting(struct list_head *sort_list, const char *arg)
break;
if (sort_dimension__add(tok, sort_list) < 0) {
error("Unknown --sort key: '%s'", tok);
free(str);
return -1;
}
}
Expand Down

0 comments on commit 1b22859

Please sign in to comment.