From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLWKd-0004ZY-ML for qemu-devel@nongnu.org; Wed, 02 Nov 2011 04:38:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLWKc-0003pL-3S for qemu-devel@nongnu.org; Wed, 02 Nov 2011 04:37:59 -0400 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:38732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLWKb-0003ny-7C for qemu-devel@nongnu.org; Wed, 02 Nov 2011 04:37:58 -0400 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 2 Nov 2011 14:07:52 +0530 From: Dong Xu Wang Date: Wed, 2 Nov 2011 16:36:21 +0800 Message-Id: <1320222981-3839-2-git-send-email-wdongxu@linux.vnet.ibm.com> In-Reply-To: <1320222981-3839-1-git-send-email-wdongxu@linux.vnet.ibm.com> References: <1320222981-3839-1-git-send-email-wdongxu@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] =?utf-8?q?=5BPATCH_2/2=5D_block=3Ause_g=5Ffree_inste?= =?utf-8?q?ad_of_free_in_cloop=2Ec?= List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Dong Xu Wang , afaerber@suse.de, raywang@linux.vnet.ibm.com From: Dong Xu Wang 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 Reviewed_by: Ray Wang Signed-off-by: Dong Xu Wang --- 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