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: Dongxu Wang <[email protected]>
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
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);
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);