qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qemu-char: Fix use of free() instead of g_free()
@ 2011-10-07  5:38 Stefan Weil
  2011-10-13  3:09 ` Dong Xu Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Weil @ 2011-10-07  5:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, 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);
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-char: Fix use of free() instead of g_free()
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Dong Xu Wang @ 2011-10-13  3:09 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-trivial, qemu-devel

于 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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-13  3:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).