From patchwork Fri Nov 14 03:25:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhanghailiang X-Patchwork-Id: 410691 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 18DA61400A0 for ; Fri, 14 Nov 2014 14:27:56 +1100 (AEDT) Received: from localhost ([::1]:34746 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xp7Y9-00075n-C4 for incoming@patchwork.ozlabs.org; Thu, 13 Nov 2014 22:27:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xp7Xn-0006nm-RX for qemu-devel@nongnu.org; Thu, 13 Nov 2014 22:27:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xp7Xi-0006ag-Kn for qemu-devel@nongnu.org; Thu, 13 Nov 2014 22:27:31 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:55994) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xp7XY-0006Mo-CF; Thu, 13 Nov 2014 22:27:16 -0500 Received: from 172.24.2.119 (EHLO szxeml404-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CCI38396; Fri, 14 Nov 2014 11:27:08 +0800 (CST) Received: from localhost (10.177.22.69) by szxeml404-hub.china.huawei.com (10.82.67.59) with Microsoft SMTP Server id 14.3.158.1; Fri, 14 Nov 2014 11:26:57 +0800 From: zhanghailiang To: Date: Fri, 14 Nov 2014 11:25:28 +0800 Message-ID: <1415935528-11792-1-git-send-email-zhang.zhanghailiang@huawei.com> X-Mailer: git-send-email 1.9.2.msysgit.0 MIME-Version: 1.0 X-Originating-IP: [10.177.22.69] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 119.145.14.65 Cc: zhanghailiang , peter.huangpeng@huawei.com, kraxel@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] gtk: fix possible memory leak about local_err 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 local_err in gd_vc_gfx_init() is not freed, and we don't use it, so remove it. Signed-off-by: zhanghailiang --- ui/gtk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/gtk.c b/ui/gtk.c index 38bf463..9496b8d 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1666,10 +1666,9 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc, QemuConsole *con, int idx, GSList *group, GtkWidget *view_menu) { - Error *local_err = NULL; Object *obj; - obj = object_property_get_link(OBJECT(con), "device", &local_err); + obj = object_property_get_link(OBJECT(con), "device", NULL); if (obj) { vc->label = g_strdup_printf("%s", object_get_typename(obj)); } else {