]> Git Repo - qemu.git/commitdiff
qemu-char: Fix use of free() instead of g_free()
authorStefan Weil <[email protected]>
Fri, 7 Oct 2011 05:38:46 +0000 (07:38 +0200)
committerStefan Hajnoczi <[email protected]>
Fri, 14 Oct 2011 13:38:13 +0000 (14:38 +0100)
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]>
qemu-char.c

index 8bdbcfdad20b004d2324a3ded9c454db2dad25db..fb9e058961874aadf3c270e34afb7fa7b829cd0b 100644 (file)
@@ -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);
This page took 0.024835 seconds and 4 git commands to generate.