diff options
author | Namhyung Kim <namhyung@gmail.com> | 2012-01-07 12:25:29 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-01-08 10:27:54 -0500 |
commit | 1b22859d4320d472a7a51ff4a43f62b0578469de (patch) | |
tree | 8608f8319ad618198850943b2ddf162913abb87b /tools/perf | |
parent | 8442da1d9f445b454accdb148355ee990ebf3b32 (diff) |
perf kmem: Fix a memory leak
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>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-kmem.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index 7a9b5c55ad5..39104c0beea 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c | |||
@@ -647,6 +647,7 @@ static int setup_sorting(struct list_head *sort_list, const char *arg) | |||
647 | break; | 647 | break; |
648 | if (sort_dimension__add(tok, sort_list) < 0) { | 648 | if (sort_dimension__add(tok, sort_list) < 0) { |
649 | error("Unknown --sort key: '%s'", tok); | 649 | error("Unknown --sort key: '%s'", tok); |
650 | free(str); | ||
650 | return -1; | 651 | return -1; |
651 | } | 652 | } |
652 | } | 653 | } |