From patchwork Tue Jan 22 10:08:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 214507 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 622A52C0079 for ; Tue, 22 Jan 2013 22:03:08 +1100 (EST) Received: from localhost ([::1]:59174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Txama-0008N8-IC for incoming@patchwork.ozlabs.org; Tue, 22 Jan 2013 05:08:44 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxamA-0007pj-Gw 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-0000CT-C0 for qemu-devel@nongnu.org; Tue, 22 Jan 2013 05:08:18 -0500 Received: from oxygen.pond.sub.org ([2a01:4f8:121:10e4::3]:48337) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Txam7-0000Bf-2y; 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 9EBD8A4310; Tue, 22 Jan 2013 11:08:10 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B1FD7200B0; Tue, 22 Jan 2013 11:08:07 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 22 Jan 2013 11:08:05 +0100 Message-Id: <1358849286-24750-11-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 10/11] 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 Note that we already free with g_free(). Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Luiz Capitulino --- 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++; }