From: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org,
Dong Xu Wang <wdongxu@linux.vnet.ibm.com>,
afaerber@suse.de, raywang@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH 2/2] block:use g_free instead of free in cloop.c
Date: Wed, 2 Nov 2011 16:36:21 +0800 [thread overview]
Message-ID: <1320222981-3839-2-git-send-email-wdongxu@linux.vnet.ibm.com> (raw)
In-Reply-To: <1320222981-3839-1-git-send-email-wdongxu@linux.vnet.ibm.com>
From: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
Fix mismatching allocation and deallocation: g_free should be used to pair with
g_malloc.
v3: Split to 2 patches: one for fixing coding style, one for replacing free with
g_free. And correct other 2 places with coding style problem.
v2: Fix spelling: gfree->g_free.
v1: Use gfree, to pair with g_malloc. Also fix coding style.
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed_by: Ray Wang <raywang@linux.vnet.ibm.com>
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
---
block/cloop.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/cloop.c b/block/cloop.c
index 799b6c2..7570eb8 100644
--- a/block/cloop.c
+++ b/block/cloop.c
@@ -171,10 +171,10 @@ static void cloop_close(BlockDriverState *bs)
{
BDRVCloopState *s = bs->opaque;
if (s->n_blocks > 0) {
- free(s->offsets);
+ g_free(s->offsets);
}
- free(s->compressed_block);
- free(s->uncompressed_block);
+ g_free(s->compressed_block);
+ g_free(s->uncompressed_block);
inflateEnd(&s->zstream);
}
--
1.7.5.4
next prev parent reply other threads:[~2011-11-02 8:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-02 8:36 [Qemu-devel] [PATCH 1/2] block:fix cloop.c coding style Dong Xu Wang
2011-11-02 8:36 ` Dong Xu Wang [this message]
2011-11-02 13:46 ` Kevin Wolf
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=1320222981-3839-2-git-send-email-wdongxu@linux.vnet.ibm.com \
--to=wdongxu@linux.vnet.ibm.com \
--cc=afaerber@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=raywang@linux.vnet.ibm.com \
/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).