From patchwork Tue Jan 22 10:08:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 214502 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 A3AEF2C0082 for ; Tue, 22 Jan 2013 21:39:52 +1100 (EST) Received: from localhost ([::1]:59182 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Txamg-0008NH-EV for incoming@patchwork.ozlabs.org; Tue, 22 Jan 2013 05:08:50 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxamA-0007pk-N5 for qemu-devel@nongnu.org; Tue, 22 Jan 2013 05:08:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Txam7-0000CP-Cb for qemu-devel@nongnu.org; Tue, 22 Jan 2013 05:08:18 -0500 Received: from oxygen.pond.sub.org ([2a01:4f8:121:10e4::3]:48338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Txam7-0000Bg-3B; Tue, 22 Jan 2013 05:08:15 -0500 Received: from blackfin.pond.sub.org (p5B329A82.dip.t-dialin.net [91.50.154.130]) by oxygen.pond.sub.org (Postfix) with ESMTPA id A4267A43D5; Tue, 22 Jan 2013 11:08:10 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id BA616200B4; Tue, 22 Jan 2013 11:08:07 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 22 Jan 2013 11:08:06 +0100 Message-Id: <1358849286-24750-12-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1358849286-24750-1-git-send-email-armbru@redhat.com> References: <1358849286-24750-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 v3 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 Reviewed-by: Eric Blake Reviewed-by: Luiz Capitulino --- 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));