提交 2e02e18b 编写于 作者: S Stefan Weil 提交者: Stefan Hajnoczi

qemu-char: Fix use of free() instead of g_free()

cppcheck reported these errors:

qemu-char.c:1667: error: Mismatching allocation and deallocation: s
qemu-char.c:1668: error: Mismatching allocation and deallocation: chr
qemu-char.c:1769: error: Mismatching allocation and deallocation: s
qemu-char.c:1770: error: Mismatching allocation and deallocation: chr
Tested-by: NDongxu Wang <wdongxu@linux.vnet.ibm.com>
Signed-off-by: NStefan Weil <sw@weilnetz.de>
Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
上级 3a846906
......@@ -1664,8 +1664,8 @@ static int qemu_chr_open_win(QemuOpts *opts, CharDriverState **_chr)
chr->chr_close = win_chr_close;
if (win_chr_init(chr, filename) < 0) {
free(s);
free(chr);
g_free(s);
g_free(chr);
return -EIO;
}
qemu_chr_generic_open(chr);
......@@ -1766,8 +1766,8 @@ static int qemu_chr_open_win_pipe(QemuOpts *opts, CharDriverState **_chr)
chr->chr_close = win_chr_close;
if (win_chr_pipe_init(chr, filename) < 0) {
free(s);
free(chr);
g_free(s);
g_free(chr);
return -EIO;
}
qemu_chr_generic_open(chr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册