qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Stefan Weil <sw@weilnetz.de>,
	Anthony Liguori <aliguori@us.ibm.com>,
	Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 2/7] qemu-char: Fix use of free() instead of g_free()
Date: Fri, 14 Oct 2011 15:11:22 +0100	[thread overview]
Message-ID: <1318601487-32419-3-git-send-email-stefanha@linux.vnet.ibm.com> (raw)
In-Reply-To: <1318601487-32419-1-git-send-email-stefanha@linux.vnet.ibm.com>

From: Stefan Weil <sw@weilnetz.de>

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 <wdongxu@linux.vnet.ibm.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 qemu-char.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 8bdbcfd..fb9e058 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.6.3

  parent reply	other threads:[~2011-10-14 14:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-14 14:11 [Qemu-devel] [PULL 0/7] Trivial patches for October 6 to 14 2011 Stefan Hajnoczi
2011-10-14 14:11 ` [Qemu-devel] [PATCH 1/7] qemu-options: avoid #if in spicevmc texi help Stefan Hajnoczi
2011-10-14 14:11 ` Stefan Hajnoczi [this message]
2011-10-14 14:11 ` [Qemu-devel] [PATCH 3/7] arm_pic: Fix typo Stefan Hajnoczi
2011-10-14 14:11 ` [Qemu-devel] [PATCH 4/7] remove hpet.h Stefan Hajnoczi
2011-10-14 14:11 ` [Qemu-devel] [PATCH 5/7] tcg: Fix spelling in comment (varables -> variables) Stefan Hajnoczi
2011-10-14 14:11 ` [Qemu-devel] [PATCH 6/7] sheepdog: correct spelling Stefan Hajnoczi
2011-10-14 14:11 ` [Qemu-devel] [PATCH 7/7] block/qcow: Fix use of free() instead of g_free() Stefan Hajnoczi
2011-10-14 16:25 ` [Qemu-devel] [PULL 0/7] Trivial patches for October 6 to 14 2011 Anthony Liguori

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=1318601487-32419-3-git-send-email-stefanha@linux.vnet.ibm.com \
    --to=stefanha@linux.vnet.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@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).