From nobody Mon Feb 9 02:24:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695903510; cv=none; d=zohomail.com; s=zohoarc; b=Qo8ru9VQ8eHW8OOiahsddvpEYey69vsmnMcGO4sBjpEEXujtfA/j+lvjWyVm1TPgtOk6r6h+/nEP6FiIGEC4Kmggs066EBopRqYBXU4Gbf8nx43osl6LSax99gWCpygCgHxvm5npnFsDjRuU4eKo+U+zb6T5ZeP4DgAXjsISR1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695903510; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=x73llW8XaTltK0XjDmdRJU/MSUyexvZbr8xrZsuRPd0=; b=kMgRMCQ304rvSySaZ55YB82zNuczzhObYC/NRLE6iSx4hYqgZLc2qkBoDTWl5drSQCkN2Rt7peNUEZKM0LIepcU4o8v9w6oSANTvfsCMqzvYG2lQRMZeCUdZaPtZK9XbsgLneTN7A4hv35bnr85BRe/S8is2aNANs1730AMePvE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1695903510692955.188000217134; Thu, 28 Sep 2023 05:18:30 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-646-bVu9hE9-N9-Jy08lhfrqWQ-1; Thu, 28 Sep 2023 08:18:26 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F21F63C0DF98; Thu, 28 Sep 2023 12:18:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3998D401025; Thu, 28 Sep 2023 12:18:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 03C911946588; Thu, 28 Sep 2023 12:18:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D28A21946587 for ; Thu, 28 Sep 2023 12:03:48 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 86E342156702; Thu, 28 Sep 2023 12:03:48 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7EDBD2156A27 for ; Thu, 28 Sep 2023 12:03:48 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 662FD811E8E for ; Thu, 28 Sep 2023 12:03:48 +0000 (UTC) Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-408-wuaBVHqdMcCkyDvXw1F1JA-1; Thu, 28 Sep 2023 08:03:46 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id ADEB21866C4E; Thu, 28 Sep 2023 14:55:40 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Cp4CU-LWiLZ8; Thu, 28 Sep 2023 14:55:40 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 6CD141866780; Thu, 28 Sep 2023 14:55:40 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id sVV0hT1uk3SF; Thu, 28 Sep 2023 14:55:40 +0300 (MSK) Received: from rbta-msk-lt-106062.astralinux.ru (unknown [10.177.20.58]) by mail.astralinux.ru (Postfix) with ESMTPSA id 18E091865E65; Thu, 28 Sep 2023 14:55:39 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695903509; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=x73llW8XaTltK0XjDmdRJU/MSUyexvZbr8xrZsuRPd0=; b=DemTjHYmScEXJ8AmmiN1NEgitt76xW4wKZhMNUuXKSs2nSDlTfDVKbvBVVRFeZH0dsE6aO P955oFVZYGSQVg4W6Xx+OTobIUjxQsy9dmJGn7OyOL3VYzKd76S/uvtc7EhMf2qqtScetR n7Gr3cI521MMSHL5D71Ai+va1M28h5g= X-MC-Unique: bVu9hE9-N9-Jy08lhfrqWQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: wuaBVHqdMcCkyDvXw1F1JA-1 X-Virus-Scanned: amavisd-new at astralinux.ru From: Anastasia Belova To: libvir-list@redhat.com Subject: [PATCH] qemu: Add VIR_FREE in ADD_BITMAP Date: Thu, 28 Sep 2023 14:55:11 +0300 Message-Id: <20230928115511.24543-1-abelova@astralinux.ru> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anastasia Belova , sdl.qemu@linuxtesting.org Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: astralinux.ru Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695903513215100001 Content-Type: text/plain; charset="utf-8"; x-default="true" virBitmapFormat returns the string that should be freed. All strings in three ADD_BITMAP calls in qemuDomainGetGuestVcpusParams are contained in tmp. So memory leak is possible here without VIR_FREE. Fixes: 3e7db8d3e8 ("Remove backslash alignment attempts") Signed-off-by: Anastasia Belova Reviewed-by: Michal Privoznik --- src/qemu/qemu_driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 9e0f204e44..a70bfb6450 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18420,6 +18420,7 @@ qemuDomainGetGuestVcpusParams(virTypedParameterPtr = *params, goto cleanup; \ if (virTypedParamsAddString(&par, &npar, &maxpar, #name, tmp) < 0) \ goto cleanup; \ + VIR_FREE(tmp); \ =20 ADD_BITMAP(vcpus); ADD_BITMAP(online); --=20 2.30.2