From patchwork Wed Jan 16 14:36:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 212532 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 E1AA82C0040 for ; Thu, 17 Jan 2013 01:37:16 +1100 (EST) Received: from localhost ([::1]:47544 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvU79-0000Ww-0B for incoming@patchwork.ozlabs.org; Wed, 16 Jan 2013 09:37:15 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvU6f-0000DA-VA for qemu-devel@nongnu.org; Wed, 16 Jan 2013 09:36:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvU6c-000268-87 for qemu-devel@nongnu.org; Wed, 16 Jan 2013 09:36:45 -0500 Received: from oxygen.pond.sub.org ([2a01:4f8:121:10e4::3]:41694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvU6b-00025K-U4; Wed, 16 Jan 2013 09:36:42 -0500 Received: from blackfin.pond.sub.org (p5B32B5E9.dip.t-dialin.net [91.50.181.233]) by oxygen.pond.sub.org (Postfix) with ESMTPA id E1834A2C87; Wed, 16 Jan 2013 15:36:39 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 20461200A8; Wed, 16 Jan 2013 15:36:39 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 16 Jan 2013 15:36:38 +0100 Message-Id: <1358346998-26328-12-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1358346998-26328-1-git-send-email-armbru@redhat.com> References: <1358346998-26328-1-git-send-email-armbru@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:4f8:121:10e4::3 Cc: qemu-trivial@nongnu.org Subject: [Qemu-devel] [PATCH 11/11] qemu-ga: Fix unchecked strdup() by converting to g_strdup() 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 I figure it's freed somewhere deep down in QAPI, with g_free(). Signed-off-by: Markus Armbruster --- qga/commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/commands.c b/qga/commands.c index 7ffb35e..528b082 100644 --- a/qga/commands.c +++ b/qga/commands.c @@ -61,7 +61,7 @@ struct GuestAgentInfo *qmp_guest_info(Error **err) while (*cmd_list) { cmd_info = g_malloc0(sizeof(GuestAgentCommandInfo)); - cmd_info->name = strdup(*cmd_list); + cmd_info->name = g_strdup(*cmd_list); cmd_info->enabled = qmp_command_is_enabled(cmd_info->name); cmd_info_list = g_malloc0(sizeof(GuestAgentCommandInfoList));