From patchwork Wed Jan 30 10:24:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 216838 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 27E0B2C0096 for ; Wed, 30 Jan 2013 22:22:01 +1100 (EST) Received: from localhost ([::1]:57553 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0Urb-00037U-Rx for incoming@patchwork.ozlabs.org; Wed, 30 Jan 2013 05:25:55 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0Ur8-0002iC-5A for qemu-devel@nongnu.org; Wed, 30 Jan 2013 05:25:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U0Ur4-0003rX-F3 for qemu-devel@nongnu.org; Wed, 30 Jan 2013 05:25:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:27243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0Ur4-0003r6-6E for qemu-devel@nongnu.org; Wed, 30 Jan 2013 05:25:22 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0UAPLv2032307 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 30 Jan 2013 05:25:21 -0500 Received: from localhost (ovpn-112-21.ams2.redhat.com [10.36.112.21]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r0UAPKNQ005292; Wed, 30 Jan 2013 05:25:21 -0500 From: Stefan Hajnoczi To: Date: Wed, 30 Jan 2013 11:24:26 +0100 Message-Id: <1359541470-30775-19-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.67 on 10.5.11.12 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 14/18] qapi: 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 Note that we already free with g_free(). Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Luiz Capitulino Signed-off-by: Stefan Hajnoczi --- qapi/qmp-registry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/qmp-registry.c b/qapi/qmp-registry.c index 70cdbca..28bbbe8 100644 --- a/qapi/qmp-registry.c +++ b/qapi/qmp-registry.c @@ -92,7 +92,7 @@ char **qmp_get_command_list(void) list_head = list = g_malloc0(count * sizeof(char *)); QTAILQ_FOREACH(cmd, &qmp_commands, node) { - *list = strdup(cmd->name); + *list = g_strdup(cmd->name); list++; }