From patchwork Sat Feb 28 10:13:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 444603 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5FCC51400F1 for ; Sat, 28 Feb 2015 21:13:39 +1100 (AEDT) Received: from localhost ([::1]:40664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YReOv-0001Td-Gr for incoming@patchwork.ozlabs.org; Sat, 28 Feb 2015 05:13:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YReOc-0000q8-5U for qemu-devel@nongnu.org; Sat, 28 Feb 2015 05:13:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YReOY-00016p-3K for qemu-devel@nongnu.org; Sat, 28 Feb 2015 05:13:18 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:57475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YReOX-00016e-S6; Sat, 28 Feb 2015 05:13:14 -0500 Received: from [192.168.88.2] (mjt.vpn.tls.msk.ru [192.168.177.99]) by isrv.corpit.ru (Postfix) with ESMTP id D3BCC43EE1; Sat, 28 Feb 2015 13:13:11 +0300 (MSK) Message-ID: <54F194B7.9080603@msgid.tls.msk.ru> Date: Sat, 28 Feb 2015 13:13:11 +0300 From: Michael Tokarev Organization: Telecom Service, JSC User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0 MIME-Version: 1.0 To: arei.gonglei@huawei.com, qemu-devel@nongnu.org References: <1425118124-11888-1-git-send-email-arei.gonglei@huawei.com> In-Reply-To: <1425118124-11888-1-git-send-email-arei.gonglei@huawei.com> OpenPGP: id=804465C5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 86.62.121.231 Cc: qemu-trivial@nongnu.org Subject: Re: [Qemu-devel] [PATCH v2] e500: 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 28.02.2015 13:08, arei.gonglei@huawei.com пишет: > From: Gonglei > > Signed-off-by: Gonglei > --- > v2: fix compilation complaint. (mjt) > --- > hw/ppc/e500.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c > index 7e17d18..c060b50 100644 > --- a/hw/ppc/e500.c > +++ b/hw/ppc/e500.c > @@ -309,8 +309,10 @@ static int ppce500_load_device_tree(MachineState *machine, > > fdt = load_device_tree(filename, &fdt_size); > if (!fdt) { > + g_free(filename); > goto out; > } > + g_free(filename); > goto done; > } How about this? Thanks, /mjt Reviewed-by: Paolo Bonzini Reviewed-by: Stefan Weil --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -308,6 +308,7 @@ static int ppce500_load_device_tree(MachineState *machine, } fdt = load_device_tree(filename, &fdt_size); + g_free(filename); if (!fdt) { goto out; }