From patchwork Wed Sep 28 06:57:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ajia@redhat.com X-Patchwork-Id: 116704 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BD661B6F7D for ; Wed, 28 Sep 2011 16:57:17 +1000 (EST) Received: from localhost ([::1]:38068 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8o4t-0006ee-NQ for incoming@patchwork.ozlabs.org; Wed, 28 Sep 2011 02:57:11 -0400 Received: from eggs.gnu.org ([140.186.70.92]:36745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8o4o-0006eZ-Kz for qemu-devel@nongnu.org; Wed, 28 Sep 2011 02:57:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8o4n-000681-VV for qemu-devel@nongnu.org; Wed, 28 Sep 2011 02:57:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34573) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8o4n-00067r-JI for qemu-devel@nongnu.org; Wed, 28 Sep 2011 02:57:05 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8S6v3aO032306 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 28 Sep 2011 02:57:03 -0400 Received: from localhost.localdomain.com ([10.66.4.201]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8S6v0GN014005; Wed, 28 Sep 2011 02:57:02 -0400 From: ajia@redhat.com To: qemu-devel@nongnu.org Date: Wed, 28 Sep 2011 14:57:01 +0800 Message-Id: <1317193022-13504-1-git-send-email-ajia@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: Alex Jia Subject: [Qemu-devel] [PATCH] fix memory leak in aio_write_f 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 From: Alex Jia Haven't released memory of 'ctx' before return. Signed-off-by: Alex Jia --- qemu-io.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/qemu-io.c b/qemu-io.c index e91af37..c45a413 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -1248,6 +1248,7 @@ static int aio_write_f(int argc, char **argv) case 'P': pattern = parse_pattern(optarg); if (pattern < 0) { + free(ctx); return 0; } break;