qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
To: Stefan Weil <sw@weilnetz.de>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qemu-char: Fix use of free() instead of g_free()
Date: Thu, 13 Oct 2011 11:09:04 +0800	[thread overview]
Message-ID: <4E965650.90807@linux.vnet.ibm.com> (raw)
In-Reply-To: <1317965926-1696-1-git-send-email-sw@weilnetz.de>

于 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<sw@weilnetz.de>
> ---
>   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 <wdongxu@linux.vnet.ibm.com>

      reply	other threads:[~2011-10-13  3:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-07  5:38 [Qemu-devel] [PATCH] qemu-char: Fix use of free() instead of g_free() Stefan Weil
2011-10-13  3:09 ` Dong Xu Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E965650.90807@linux.vnet.ibm.com \
    --to=wdongxu@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=sw@weilnetz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).