From patchwork Tue Oct 20 01:51:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Hongyang X-Patchwork-Id: 532763 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 E655514116E for ; Tue, 20 Oct 2015 12:52:28 +1100 (AEDT) Received: from localhost ([::1]:42928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoM6E-0001Tj-Vp for incoming@patchwork.ozlabs.org; Mon, 19 Oct 2015 21:52:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoM5s-0000vR-Gn for qemu-devel@nongnu.org; Mon, 19 Oct 2015 21:52:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoM5p-0001Ol-BX for qemu-devel@nongnu.org; Mon, 19 Oct 2015 21:52:04 -0400 Received: from [59.151.112.132] (port=7052 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoM5o-0001KP-W6 for qemu-devel@nongnu.org; Mon, 19 Oct 2015 21:52:01 -0400 X-IronPort-AV: E=Sophos;i="5.15,520,1432569600"; d="scan'208";a="102031641" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 20 Oct 2015 09:54:17 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id t9K1pPNA001194; Tue, 20 Oct 2015 09:51:25 +0800 Received: from localhost (10.167.226.223) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Tue, 20 Oct 2015 09:51:55 +0800 From: Yang Hongyang To: Date: Tue, 20 Oct 2015 09:51:26 +0800 Message-ID: <1445305886-11901-2-git-send-email-yanghy@cn.fujitsu.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445305886-11901-1-git-send-email-yanghy@cn.fujitsu.com> References: <1445305886-11901-1-git-send-email-yanghy@cn.fujitsu.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 59.151.112.132 Cc: Paolo Bonzini , Jason Wang , Yang Hongyang Subject: [Qemu-devel] [PATCH 2/2] net: free the string returned by object_get_canonical_path_component 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 value returned from object_get_canonical_path_component must be freed. Signed-off-by: Yang Hongyang Cc: Jason Wang Cc: Paolo Bonzini --- net/net.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/net.c b/net/net.c index 0c4a012..459bf19 100644 --- a/net/net.c +++ b/net/net.c @@ -1189,10 +1189,11 @@ void print_net_client(Monitor *mon, NetClientState *nc) monitor_printf(mon, "filters:\n"); } QTAILQ_FOREACH(nf, &nc->filters, next) { - monitor_printf(mon, " - %s: type=%s%s\n", - object_get_canonical_path_component(OBJECT(nf)), + char *path = object_get_canonical_path_component(OBJECT(nf)); + monitor_printf(mon, " - %s: type=%s%s\n", path, object_get_typename(OBJECT(nf)), nf->info_str); + g_free(path); } }