From patchwork Wed Jan 28 14:54:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 433885 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A111B1401F6 for ; Thu, 29 Jan 2015 01:56:51 +1100 (AEDT) Received: from localhost ([::1]:53968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGU2z-0003xD-Uk for incoming@patchwork.ozlabs.org; Wed, 28 Jan 2015 09:56:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGU0W-0007kY-G7 for qemu-devel@nongnu.org; Wed, 28 Jan 2015 09:54:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGU0P-0006Gn-Cg for qemu-devel@nongnu.org; Wed, 28 Jan 2015 09:54:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGU0P-0006Gc-4p; Wed, 28 Jan 2015 09:54:09 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0SEs7fu021491 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 28 Jan 2015 09:54:08 -0500 Received: from blackfin.pond.sub.org (ovpn-116-51.ams2.redhat.com [10.36.116.51]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t0SEs557021854 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 28 Jan 2015 09:54:06 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 010CF30000B4; Wed, 28 Jan 2015 15:54:04 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 28 Jan 2015 15:54:01 +0100 Message-Id: <1422456844-13043-2-git-send-email-armbru@redhat.com> In-Reply-To: <1422456844-13043-1-git-send-email-armbru@redhat.com> References: <1422456844-13043-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-trivial@nongnu.org Subject: [Qemu-devel] [PATCH 1/4] qemu-option: Replace pointless use of g_malloc0() by g_malloc() 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 get_opt_value() takes a write-only buffer, so zeroing it is pointless. We don't do it elsewhere, either. Signed-off-by: Markus Armbruster Reviewed-by: Gonglei --- util/qemu-option.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/qemu-option.c b/util/qemu-option.c index a708241..c779150 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -213,7 +213,7 @@ void parse_option_size(const char *name, const char *value, bool has_help_option(const char *param) { size_t buflen = strlen(param) + 1; - char *buf = g_malloc0(buflen); + char *buf = g_malloc(buflen); const char *p = param; bool result = false; @@ -237,7 +237,7 @@ out: bool is_valid_option_list(const char *param) { size_t buflen = strlen(param) + 1; - char *buf = g_malloc0(buflen); + char *buf = g_malloc(buflen); const char *p = param; bool result = true;