From patchwork Wed Jan 30 10:24:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 216831 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 47D352C008E for ; Wed, 30 Jan 2013 22:12:13 +1100 (EST) Received: from localhost ([::1]:57864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0Urg-0003HC-Dh for incoming@patchwork.ozlabs.org; Wed, 30 Jan 2013 05:26:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0UrA-0002iN-93 for qemu-devel@nongnu.org; Wed, 30 Jan 2013 05:25:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U0Ur6-0003si-FZ for qemu-devel@nongnu.org; Wed, 30 Jan 2013 05:25:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:10952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0Ur6-0003sT-6z for qemu-devel@nongnu.org; Wed, 30 Jan 2013 05:25:24 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0UAPNRf016962 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 30 Jan 2013 05:25:23 -0500 Received: from localhost (ovpn-112-21.ams2.redhat.com [10.36.112.21]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0UAPMRg027975; Wed, 30 Jan 2013 05:25:23 -0500 From: Stefan Hajnoczi To: Date: Wed, 30 Jan 2013 11:24:27 +0100 Message-Id: <1359541470-30775-20-git-send-email-stefanha@redhat.com> In-Reply-To: <1359541470-30775-1-git-send-email-stefanha@redhat.com> References: <1359541470-30775-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Anthony Liguori , Markus Armbruster , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 15/18] 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 From: Markus Armbruster 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 Signed-off-by: Stefan Hajnoczi --- 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));