提交 fbee8d93 编写于 作者: V Vitaliy Ivanov 提交者: Linus Torvalds

uml: drivers/net_user.c memory leak fix

Perform memory cleanup on exit.  On receiving invalid 'pid' we still
should clean 'output' variable.
Signed-off-by: NVitaliy Ivanov <vitalivanov@gmail.com>
Signed-off-by: NRichard Weinberger <richard@nod.at>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 7fa38e7e
......@@ -228,7 +228,10 @@ static void change(char *dev, char *what, unsigned char *addr,
"buffer\n");
pid = change_tramp(argv, output, output_len);
if (pid < 0) return;
if (pid < 0) {
kfree(output);
return;
}
if (output != NULL) {
printk("%s", output);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册