From patchwork Wed Jan 16 20:20:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 213056 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 939722C0080 for ; Thu, 17 Jan 2013 07:53:39 +1100 (EST) Received: from localhost ([::1]:55011 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvZzN-0002o8-QV for incoming@patchwork.ozlabs.org; Wed, 16 Jan 2013 15:53:37 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvZz9-0002c4-Ux for qemu-devel@nongnu.org; Wed, 16 Jan 2013 15:53:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvZz9-0007VT-3K for qemu-devel@nongnu.org; Wed, 16 Jan 2013 15:53:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:29079) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvZz4-0007U0-M1; Wed, 16 Jan 2013 15:53:18 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0GKrGtO010714 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 16 Jan 2013 15:53:17 -0500 Received: from dhcp-5-188.str.redhat.com (vpn1-6-32.ams2.redhat.com [10.36.6.32]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0GKK1gu026548; Wed, 16 Jan 2013 15:20:43 -0500 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Wed, 16 Jan 2013 21:20:00 +0100 Message-Id: <1358367600-8074-3-git-send-email-kwolf@redhat.com> In-Reply-To: <1358367600-8074-1-git-send-email-kwolf@redhat.com> References: <1358367600-8074-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-stable@nongnu.org, stefanha@redhat.com Subject: [Qemu-devel] [PATCH 2/2] win32-aio: Fix memory leak X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The buffer is allocated for both reads and writes, and obviously it should be freed even if an error occurs. Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf --- block/win32-aio.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block/win32-aio.c b/block/win32-aio.c index 53b82e6..546a60d 100644 --- a/block/win32-aio.c +++ b/block/win32-aio.c @@ -87,8 +87,8 @@ static void win32_aio_process_completion(QEMUWin32AIOState *s, memcpy(qiov->iov[i].iov_base, p, qiov->iov[i].iov_len); p += qiov->iov[i].iov_len; } - g_free(waiocb->buf); } + g_free(waiocb->buf); }