From patchwork Wed Apr 21 18:27:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 93920 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3LIRINE021397 for ; Wed, 21 Apr 2010 18:27:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756062Ab0DUS1Q (ORCPT ); Wed, 21 Apr 2010 14:27:16 -0400 Received: from mtagate2.de.ibm.com ([195.212.17.162]:60012 "EHLO mtagate2.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756024Ab0DUS1O (ORCPT ); Wed, 21 Apr 2010 14:27:14 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.13.1/8.13.1) with ESMTP id o3LIRDFZ006275 for ; Wed, 21 Apr 2010 18:27:13 GMT Received: from d12av04.megacenter.de.ibm.com (d12av04.megacenter.de.ibm.com [9.149.165.229]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o3LIRDUd1679468 for ; Wed, 21 Apr 2010 20:27:13 +0200 Received: from d12av04.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o3LIRCgB008285 for ; Wed, 21 Apr 2010 20:27:13 +0200 Received: from localhost.localdomain (sig-9-145-133-64.de.ibm.com [9.145.133.64]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id o3LIRCr5008282; Wed, 21 Apr 2010 20:27:12 +0200 From: Stefan Hajnoczi To: kvm@vger.kernel.org Cc: Leszek Urbanski , Michael Tokarev , Ryan Harper , Stefan Hajnoczi Subject: [PATCH] block: Free iovec arrays allocated by multiwrite_merge() Date: Wed, 21 Apr 2010 19:27:44 +0100 Message-Id: <1271874464-3021-1-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.0 In-Reply-To: <20100421143209.GC24351@us.ibm.com> References: <20100421143209.GC24351@us.ibm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 21 Apr 2010 18:27:19 +0000 (UTC) diff --git a/block.c b/block.c index e891544..2d31474 100644 --- a/block.c +++ b/block.c @@ -1731,6 +1731,9 @@ static void multiwrite_user_cb(MultiwriteCB *mcb) for (i = 0; i < mcb->num_callbacks; i++) { mcb->callbacks[i].cb(mcb->callbacks[i].opaque, mcb->error); + if (mcb->callbacks[i].free_qiov) { + qemu_iovec_destroy(mcb->callbacks[i].free_qiov); + } qemu_free(mcb->callbacks[i].free_qiov); qemu_vfree(mcb->callbacks[i].free_buf); }