From nobody Sun Jul 26 11:53:08 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=proton.me ARC-Seal: i=1; a=rsa-sha256; t=1782780847; cv=none; d=zohomail.com; s=zohoarc; b=I6aD8cuHzbrvmgzFGLI420ZPwotNvhuhVMtbtEV8R/pUP+IhgsmCjvRX/FmzBNdeKEJf5QpzvcgrmfXHMWU3YidUiVht7MkOfW7+UZoJBeLSL9+By6jT8GsBmK/qVcWrCrJ4VpGXvdAniyZAR+qxgp659Z/yQtwVKYrS49Z96ZU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782780847; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=bBjAfTrIb9Y10u2olbxk1QFjmsldBZWC2wJZIiZJYFk=; b=FkhwHNg0tT3eUNxoInEjBFkNy+VgwjaaaiYlpHysCc9k9hDdCHLLjV600ZA0uf3MDmHcCc8vE1tJGNzvpQpNy83UmsTvIMYqpyx/cZ5R+oZF7Ww0VScKWkDfuvUwBmHCnkjUCLn3rxN17GJKBK7MvgjoadSMNyA3+BJEKRbAWMw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782780847614920.9452955133646; Mon, 29 Jun 2026 17:54:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1weMj4-0005fK-Gd; Mon, 29 Jun 2026 20:53:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1weMj2-0005f6-Gv for qemu-devel@nongnu.org; Mon, 29 Jun 2026 20:53:20 -0400 Received: from mail-07.mail-europe.com ([188.165.51.139]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1weMiz-0002ie-9h for qemu-devel@nongnu.org; Mon, 29 Jun 2026 20:53:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1782780784; x=1783039984; bh=bBjAfTrIb9Y10u2olbxk1QFjmsldBZWC2wJZIiZJYFk=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=ZySVmqanESYfrF4XYiukU6hw9kT8n60nHPz8CtRv49vQw6y1X6Xc5am3vIVsOBF9F hJ1MyKoY3RjxHzcGc3H/ZdMvRaqNeqI2ydZitCnEj6FoS64oJIif30hhDqtigOnoxa DOZOMtZQooqTj6jcqC3/V4ABiIJcGfRJqXKNcEpRUVRQmAjvZCME1ovuExL1Y5foCA RLZsBctnBHMmHzesVcHJgWpkKuUggnBRF9xG9INK8gkVnYeSNETJVrSVyOwoyy16L7 moqHLq0wRHxxe9WB8Y3STmlf73k+Y4XBskRtjl8jCw3VbvLzbNbqS9T9T84ylHXHKL 7HJbcqpQc90LA== Date: Tue, 30 Jun 2026 00:52:56 +0000 To: qemu-devel@nongnu.org, Laurent Vivier From: "Christian S. Lima" Subject: [PATCH] disas: converts malloc to g_malloc0 Message-ID: <20260630005249.143976-1-christianslima@proton.me> Feedback-ID: 169431447:user:proton X-Pm-Message-ID: 40579b4f83561569ab02d89be8ca914619536525 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=188.165.51.139; envelope-from=christianslima@proton.me; helo=mail-07.mail-europe.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @proton.me) X-ZM-MESSAGEID: 1782780850756158500 Content-Type: text/plain; charset="utf-8" Following the qemu coding style change malloc to g_malloc, the advantages are that g_malloc will exit if some failure occur and initialize all memory with zeros. Signed-off-by: Christian S. Lima --- disas/m68k.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/disas/m68k.c b/disas/m68k.c index 800b4145ac..e629f3c365 100644 --- a/disas/m68k.c +++ b/disas/m68k.c @@ -1887,8 +1887,8 @@ print_insn_m68k (bfd_vma memaddr, disassemble_info *i= nfo) =20 /* Then create a sorted table of pointers that point into the unsorted table. */ - opc_pointer[0] =3D malloc (sizeof (struct m68k_opcode *) - * m68k_numopcodes); + opc_pointer[0] =3D g_malloc0 (sizeof (struct m68k_opcode) + * m68k_numopcodes); opcodes[0] =3D opc_pointer[0]; =20 for (i =3D 1; i < 16; i++) --=20 2.53.0