From nobody Sun Feb 8 14:34:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1770133578; cv=none; d=zohomail.com; s=zohoarc; b=JoblzAcXfOgfQMdSRBerVdOqzYNrWnhZBVi58SEXY0lT5OSy210s6IsYjlwCcOIlWqTAnkdKr4CKXhN1o6jZP77g9NackbuJZkL5CvhnQmcJ8DHN5zr5xKHtOC1diBziP0WgP7019Wy/ukSX5N4dyDXG53+mtE3WDt7qDP6E9cE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770133578; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=foeMUW501Zzh9PL+84atxDXLRkwsp8VEJaTinH26ja8=; b=RzsY/5s629Ufk7BNkE1BsuwGjZgnGhghOPeCOKjWDR7TrOVFFfW+bE7OHmzvKVmV90XTRagMBW6tZZmzKQwBUtZgAJaQu0AAZtyf3JnzgvcSuPhwA/m4MtkW6fd77u1vH9M2QWlsxqCD2UStmfjV5+BYodsrWqGxb7+nUxkUDo8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1770133578077956.163047894322; Tue, 3 Feb 2026 07:46:18 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 3E72241B70; Tue, 3 Feb 2026 10:46:17 -0500 (EST) Received: from [172.19.199.6] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 7CE8743EE8; Tue, 3 Feb 2026 10:41:57 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 0AE6141ACB; Tue, 3 Feb 2026 10:41:52 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id B42B841C80 for ; Tue, 3 Feb 2026 10:40:10 -0500 (EST) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-628-phaFsQkVPLCSv-9JykSEvQ-1; Tue, 03 Feb 2026 10:40:09 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4670C180044D for ; Tue, 3 Feb 2026 15:40:08 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A4C721956048 for ; Tue, 3 Feb 2026 15:40:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770133210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=foeMUW501Zzh9PL+84atxDXLRkwsp8VEJaTinH26ja8=; b=biyMBZ1zgWpG44pXDbXLdq8jYg09HUiuMlM+yUzBo83hmNIECpk9ZZpLNAqm+K7CE0WoDp yTSmxoy6ukVBEGgjbcTLCi4/3f0FYX3pXm1BT18+z1+bO4JcVFHtVbsqjp8QzphNDma+9x zHAryt8EuS1chGranw7mrgNL0doK0bw= X-MC-Unique: phaFsQkVPLCSv-9JykSEvQ-1 X-Mimecast-MFC-AGG-ID: phaFsQkVPLCSv-9JykSEvQ_1770133208 To: devel@lists.libvirt.org Subject: [PATCH 7/9] bhyvexml2argvtest: Don't leak parts of driver config Date: Tue, 3 Feb 2026 16:39:55 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 6s9jm62EWCirzHG7xdX8w_m8H3K8urS0CuXk3aKMx_U_1770133208 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: VQX2W5PQXIYP67PXDVI2XTQDVFSDU7XM X-Message-ID-Hash: VQX2W5PQXIYP67PXDVI2XTQDVFSDU7XM X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1770133578483158500 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik At the beginning of mymain() the virBhyveDriverConfigNew() is called which inits driver config with some paths. These are then overwritten to produce stable test output. Well, the old ones should be freed first. 128 bytes in 1 blocks are definitely lost in loss record 453 of 508 at 0x4883224: malloc (vg_replace_malloc.c:451) by 0x506BD16: vasprintf_l (in /lib/libc.so.7) by 0x4F39073: g_vasprintf (in /usr/local/lib/libglib-2.0.so.0.8400.4) by 0x4F01288: g_strdup_printf (in /usr/local/lib/libglib-2.0.so.0.8400.4) by 0x401F75B: virBhyveDriverConfigNew (bhyve_conf.c:62) by 0x4013FAA: mymain (bhyvexml2argvtest.c:164) by 0x4018892: virTestMain (testutils.c:913) by 0x4013DC6: main (bhyvexml2argvtest.c:352) 25 bytes in 1 blocks are definitely lost in loss record 206 of 508 at 0x4883224: malloc (vg_replace_malloc.c:451) by 0x4EE6562: g_malloc (in /usr/local/lib/libglib-2.0.so.0.8400.4) by 0x4F0100F: g_strdup (in /usr/local/lib/libglib-2.0.so.0.8400.4) by 0x401F715: g_strdup_inline (gstrfuncs.h:321) by 0x401F715: virBhyveDriverConfigNew (bhyve_conf.c:60) by 0x4013FAA: mymain (bhyvexml2argvtest.c:164) by 0x4018892: virTestMain (testutils.c:913) by 0x4013DC6: main (bhyvexml2argvtest.c:352) Signed-off-by: Michal Privoznik --- tests/bhyvexml2argvtest.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c index 51273295b5..8f078f9d78 100644 --- a/tests/bhyvexml2argvtest.c +++ b/tests/bhyvexml2argvtest.c @@ -164,8 +164,10 @@ mymain(void) if (!(driver.config =3D virBhyveDriverConfigNew())) return EXIT_FAILURE; =20 - driver.config->firmwareDir =3D fakefirmwaredir; - driver.config->nvramDir =3D fakenvramdir; + VIR_FREE(driver.config->firmwareDir); + VIR_FREE(driver.config->nvramDir); + driver.config->firmwareDir =3D g_steal_pointer(&fakefirmwaredir); + driver.config->nvramDir =3D g_steal_pointer(&fakenvramdir); driver.config->bhyveloadTimeout =3D 0; driver.config->bhyveloadTimeoutKill =3D 0; =20 --=20 2.52.0