提交 1b22859d 编写于 作者: N Namhyung Kim 提交者: Arnaldo Carvalho de Melo

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.comSigned-off-by: NNamhyung Kim <namhyung@gmail.com>
Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 8442da1d
...@@ -647,6 +647,7 @@ static int setup_sorting(struct list_head *sort_list, const char *arg) ...@@ -647,6 +647,7 @@ static int setup_sorting(struct list_head *sort_list, const char *arg)
break; break;
if (sort_dimension__add(tok, sort_list) < 0) { if (sort_dimension__add(tok, sort_list) < 0) {
error("Unknown --sort key: '%s'", tok); error("Unknown --sort key: '%s'", tok);
free(str);
return -1; return -1;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册