[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH] qemu-char: Fix use of free() ins
From: |
Dong Xu Wang |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH] qemu-char: Fix use of free() instead of g_free() |
Date: |
Thu, 13 Oct 2011 11:09:04 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:7.0) Gecko/20110822 Thunderbird/7.0 |
δΊ 10/07/2011 01:38 PM, Stefan Weil ει:
> 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
>
> Signed-off-by: Stefan Weil<address@hidden>
> ---
> qemu-char.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/qemu-char.c b/qemu-char.c
> index 09d2309..e1b2b87 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -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);
Tested-by: Dongxu Wang <address@hidden>