From nobody Mon Feb 9 17:24:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570035641; cv=none; d=zoho.com; s=zohoarc; b=UIaFtEwRPodAocaR1KOGHlwqtJ4/V+eqIcOvGpRtRO28skFd2dfyvUUrraWKb7mFK7u0Z2QCp2l4pp8XPVXAUx+3BWsZrZ1YuCW5N4PNHHNYJMaPNvQtGtMamMvRWKC81X2dg8hI/SY2IJwDmurEFhSAmvQR1OHXyRCsq1+zWxc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570035641; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Gwkm7BIFv5Gq9pCfaTUHfWzPGvgH4PsTi5+em8nFU0M=; b=a5LMvq+9Z6HGo1D0fWObNIJoCXdYI51u+Fi+WxIZvAJaMu5tB0EfGxxQuMjLOudZ3YVwf7RqhzvRPBi3H9Wl+cITzuYufWk1WmyFfXm0WmAltyYjRaOUpMKSR+4hV7vIBlv3IZtm7En6xLfcBisjO22EiLNLwQPlECw/hNChR6o= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1570035641774972.9649285299007; Wed, 2 Oct 2019 10:00:41 -0700 (PDT) Received: from localhost ([::1]:57758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFhzR-00067x-7g for importer@patchew.org; Wed, 02 Oct 2019 13:00:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35416) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFhrK-0005Oy-Qr for qemu-devel@nongnu.org; Wed, 02 Oct 2019 12:52:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFhrJ-0003OF-QR for qemu-devel@nongnu.org; Wed, 02 Oct 2019 12:52:14 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:33792) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFhrJ-0003MW-Jx for qemu-devel@nongnu.org; Wed, 02 Oct 2019 12:52:13 -0400 Received: by mail-wm1-x32e.google.com with SMTP id y135so5358831wmc.1 for ; Wed, 02 Oct 2019 09:52:13 -0700 (PDT) Received: from 640k.localdomain ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id g4sm27303990wrw.9.2019.10.02.09.52.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Oct 2019 09:52:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Gwkm7BIFv5Gq9pCfaTUHfWzPGvgH4PsTi5+em8nFU0M=; b=fa4o45vjhLkC08Qa54nmAY9BTjZkdWS9WoeavtDyiAVR9pWHSDqqxFUAaDGkkzd6MF o/Db/MSf6/FbO6DBLKK7fbzfAygckuTTvhh0N2Wi6BE1UM3KIipCcYcI0R/Ga9W9QTki ZoQ1Nrj0LBfa4C57qS3VDhS64Kr0cQE/7NgVtzpnvIlDLR92X9Ze8TWup6d/P/NeYsFV 6mIV9J9pirfasWT0BsJpDGWwHnv28NegO1L1ovC9X2dC1z1BevEGDO/D9b98CW/vwN8P idX9Eq5PHkLrIXZXnWUcWrmkxPme6jPT5bklY2/QPXwZK8xZc6wIliFqk34O+QGP2zRx n6OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Gwkm7BIFv5Gq9pCfaTUHfWzPGvgH4PsTi5+em8nFU0M=; b=qI0nmQH242TeYwgsUb2OeDVhWAnDW6yBM4SBfhWDNCHhNtykrHguCgKwBi8yxWlB6k rCP6QwEw6drdYOUln1Qx3fBnqRZUKUtVRZVlli0R1pdGrX6qCtqFU9fDi21TU+Hc2pJK 55Sf4ByW5d2vwCMfbh6+KghIi0t5gzgK3qh9aWgDSWYg1MeaOLhxxJF3Ey8HlzroWrbU G/qDmRmggONJqHi+fiApliQXwW/SqwQWOxW6nvbhnrL1yVjM3LbEAJBqxX0PioHgGqYC oN8u+K/oa2T/6viKV7KkJ//wBe2vkUlfvJSupuXdulhiSYPA9HDW6NOpBMT8UrGB/8/D f8aQ== X-Gm-Message-State: APjAAAXr7YrAu3kqMdoWF4u2/rYNS+bX535Be+7Q4NpMRhBUb+du2h+d SRQuoad0W4s3QgEcMLTYfAZ0uWRb X-Google-Smtp-Source: APXvYqwewTrRnzms8LNKk1xv0R958YgLVK+AnWrOfifhvJyGI4yllqhI9ouvdRWmpobgPO0yZjjJoA== X-Received: by 2002:a1c:7c15:: with SMTP id x21mr3384082wmc.36.1570035132386; Wed, 02 Oct 2019 09:52:12 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 17/30] hppa: fix leak from g_strdup_printf Date: Wed, 2 Oct 2019 18:51:40 +0200 Message-Id: <1570035113-56848-18-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1570035113-56848-1-git-send-email-pbonzini@redhat.com> References: <1570035113-56848-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32e X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) memory_region_init_* takes care of copying the name into memory it owns. Free it in the caller. Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/hppa/dino.c | 1 + hw/hppa/machine.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index e0466ee..ab6969b 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -485,6 +485,7 @@ PCIBus *dino_init(MemoryRegion *addr_space, memory_region_init_alias(&s->pci_mem_alias[i], OBJECT(s), name, &s->pci_mem, addr, DINO_MEM_CHUNK_SIZE); + g_free(name); } =20 /* Set up PCI view of memory: Bus master address space. */ diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 2736ce8..7e23675 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -78,13 +78,15 @@ static void machine_hppa_init(MachineState *machine) =20 /* Create CPUs. */ for (i =3D 0; i < smp_cpus; i++) { + char *name =3D g_strdup_printf("cpu%ld-io-eir", i); cpu[i] =3D HPPA_CPU(cpu_create(machine->cpu_type)); =20 cpu_region =3D g_new(MemoryRegion, 1); memory_region_init_io(cpu_region, OBJECT(cpu[i]), &hppa_io_eir_ops, - cpu[i], g_strdup_printf("cpu%ld-io-eir", i),= 4); + cpu[i], name, 4); memory_region_add_subregion(addr_space, CPU_HPA + i * 0x1000, cpu_region); + g_free(name); } =20 /* Limit main memory. */ --=20 1.8.3.1