From nobody Mon Apr 29 12:01:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1556005205; cv=none; d=zoho.com; s=zohoarc; b=K3+96iKr6xiRFyj3q8r92B48/pBXVgE8o2NLD3dZVPDKW0u4PELR6zCpEH1Zcb9Q4Zyj4dKJnZP2Drjl0nBE9FIcZNV+whuEDZpyS64o+9EtjzGp3RamMs4pJDYEsrr1YV8iRn65dd0Mr8p6YcQHA1Nwl+ZERetkQ7amBAGmo2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556005205; 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=1ks1wQO9c9YK0qP5afA2mIti8TDh7VuWlGrF1Gmf7II=; b=d0n3ku8f0g53TBWUXcrPjoKeTOSlR2Wb2mRhXUC2jObGL3E8s5LkrXOrawaKSr0v1XpcAiT6pParSGpiQmrplBzRminItN7kvRXu0kv7YO4Ch6XKIwp1Bh4aXb4gsvniNjCUWxpO0Omo+iGvModpcOcZj8q8HmjKw6r529v/dy4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1556005205467912.0236183974315; Tue, 23 Apr 2019 00:40:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C4272C050DEC; Tue, 23 Apr 2019 07:40:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5D9046013B; Tue, 23 Apr 2019 07:40:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 00ECE3D86; Tue, 23 Apr 2019 07:40:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3N7dfng024259 for ; Tue, 23 Apr 2019 03:39:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 15DBF5D71D; Tue, 23 Apr 2019 07:39:41 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 92EEA5D71F for ; Tue, 23 Apr 2019 07:39:38 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 23 Apr 2019 09:39:31 +0200 Message-Id: <8bf7cc5fac6cf09208e38b2df6f2818a54019b46.1556004845.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] qemucaps2xmltest: Don't leak @binary X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 23 Apr 2019 07:40:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" There's no need to keep @binary around. virQEMUCapsInitGuestFromBinary() duplicates the string anyway. 1,002 bytes in 36 blocks are definitely lost in loss record 54 of 59 at 0x483579F: malloc (vg_replace_malloc.c:299) by 0x796B1C7: vasprintf (vasprintf.c:73) by 0x4C3F2C6: virVasprintfInternal (virstring.c:740) by 0x4C3F3DC: virAsprintfInternal (virstring.c:761) by 0x13AFC9: testGetCaps (qemucaps2xmltest.c:105) by 0x13B200: testQemuCapsXML (qemucaps2xmltest.c:157) by 0x13B642: virTestRun (testutils.c:174) by 0x13B366: doCapsTest (qemucaps2xmltest.c:191) by 0x13FF2B: testQemuCapsIterate (testutilsqemu.c:941) by 0x13B427: mymain (qemucaps2xmltest.c:215) by 0x13D706: virTestMain (testutils.c:1096) by 0x13B489: main (qemucaps2xmltest.c:221) Signed-off-by: Michal Privoznik --- tests/qemucaps2xmltest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c index d107b32221..08dc598541 100644 --- a/tests/qemucaps2xmltest.c +++ b/tests/qemucaps2xmltest.c @@ -100,7 +100,7 @@ testGetCaps(char *capsData, const testQemuData *data) virQEMUCapsPtr qemuCaps =3D NULL; virCapsPtr caps =3D NULL; virArch arch =3D virArchFromString(data->archName); - char *binary =3D NULL; + VIR_AUTOFREE(char *) binary =3D NULL; =20 if (virAsprintf(&binary, "/usr/bin/qemu-system-%s", data->archName) < = 0) goto error; @@ -129,7 +129,6 @@ testGetCaps(char *capsData, const testQemuData *data) error: virObjectUnref(qemuCaps); virObjectUnref(caps); - VIR_FREE(binary); return NULL; } =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 12:01:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1556005188; cv=none; d=zoho.com; s=zohoarc; b=AC2Xl/fH9lBZviV6gTCR5+mqUDKRS2a/eBxKfMrYG83gZYReuU9e1Mqbr/rFGSmX/XsFXByMwhcE1d/0ypFR5zYV3esiDPQUpMCqcdcGnogJCRq32idx2DflTV673GTXXx5ynLwOzsmlNPJqCOkZgx9blavYhrI0xnCFz5q2Yxc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556005188; 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=BSts65/beJ9a4dawUkRsW2egXVP2u29Ei7u9RiSulUU=; b=ZCNkxfMUudfYv8+ElX9hoXigcSfMqPFz0Q444Z6iU3Xj99sXFDlv9f8Yup8QpuWm49AEQkAl/rVkt4M0ImTMYuYmIcobdIOw/0w9WymeY6JZD0eZiS7tO9k8qK3Spujo2tHAfuivkwsY3Um8DBpk9UTWG9UGI6D8ZqdKohq79oA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1556005188779145.95276409408154; Tue, 23 Apr 2019 00:39:48 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 19404307D8BE; Tue, 23 Apr 2019 07:39:47 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6E9BF60C62; Tue, 23 Apr 2019 07:39:46 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1B52C41F3C; Tue, 23 Apr 2019 07:39:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3N7dfBD024268 for ; Tue, 23 Apr 2019 03:39:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id DA6B05D720; Tue, 23 Apr 2019 07:39:41 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62D295D71D for ; Tue, 23 Apr 2019 07:39:41 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 23 Apr 2019 09:39:32 +0200 Message-Id: <4f18b2d755b7de415fa96f23effc71a37777e2c3.1556004845.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] libxlDriverConfigDispose: Free @configBaseDir too X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 23 Apr 2019 07:39:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Allocated in libxlDriverConfigNew(), the @configBaseDir is never freed. 13 bytes in 1 blocks are definitely lost in loss record 36 of 125 at 0x483579F: malloc (vg_replace_malloc.c:299) by 0x8012469: strdup (strdup.c:42) by 0x52926DE: virStrdup (virstring.c:966) by 0x11D46B: libxlDriverConfigNew (libxl_conf.c:1749) by 0x114D78: testCompareXMLToDomConfig (libxlxml2domconfigtest.c:62) by 0x1152A3: testCompareXMLToDomConfigHelper (libxlxml2domconfigtest.c:= 160) by 0x115925: virTestRun (testutils.c:174) by 0x1154A4: mymain (libxlxml2domconfigtest.c:216) by 0x1179E9: virTestMain (testutils.c:1096) by 0x1154FD: main (libxlxml2domconfigtest.c:224) Signed-off-by: Michal Privoznik --- src/libxl/libxl_conf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index c701df3370..315c14652b 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -79,6 +79,7 @@ libxlDriverConfigDispose(void *obj) if (cfg->logger) libxlLoggerFree(cfg->logger); =20 + VIR_FREE(cfg->configBaseDir); VIR_FREE(cfg->configDir); VIR_FREE(cfg->autostartDir); VIR_FREE(cfg->logDir); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 12:01:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1556005209; cv=none; d=zoho.com; s=zohoarc; b=e3UKpv0n/C3+kfVJnSz6qYeJAljN/r53pwQR/6fR9GuOSDJQzjFB+c70ISvIPHMaYPBoqvymX39XASO5UUvgQLL5FlpfM5Z9Z/sEhMTO4ncaZy1V5yqGAlnXcJTxtG4fU4jcKGly4myWdfZDyI9iQMTDnqItTTXE8KvNhX2PEGM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556005209; 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=biwQV29GOg5ToHAKjzLR2AXXzzakOiAltxlLoVcVFVU=; b=X/WVagXTAGl85j7NNl6NyskckVNulGjAu1ozzFVXC6HWpLiiNkCxWc5vLcAH9ptZKTL35Itt6qWFS2mK5lwP57JvezZrCEAmqimtvhK1QC+KNdfjwqakIsXCWKugntvGL3hAuGKz6Z1/G7zgYF2B5MpqwU3xaQznjS032e3G7jo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1556005209724444.7890961887173; Tue, 23 Apr 2019 00:40:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 24B533083391; Tue, 23 Apr 2019 07:40:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DDBE35D721; Tue, 23 Apr 2019 07:40:07 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8370D181AC48; Tue, 23 Apr 2019 07:40:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3N7didO024278 for ; Tue, 23 Apr 2019 03:39:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0DFF65D720; Tue, 23 Apr 2019 07:39:44 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B9BC5D71D for ; Tue, 23 Apr 2019 07:39:42 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 23 Apr 2019 09:39:33 +0200 Message-Id: <219b897ce2408a1c161a189977367e231d41c885.1556004845.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] vmx: Free @firmware in virVMXParseConfig X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 23 Apr 2019 07:40:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The @firmware string is allocated, but never freed. 4 bytes in 1 blocks are definitely lost in loss record 1 of 44 at 0x483579F: malloc (vg_replace_malloc.c:299) by 0x76FB469: strdup (strdup.c:42) by 0x497B6DE: virStrdup (virstring.c:966) by 0x48F6FD3: virConfGetValueString (virconf.c:908) by 0x4B3E9B6: virVMXGetConfigStringHelper (vmx.c:736) by 0x4B3EA6B: virVMXGetConfigString (vmx.c:756) by 0x4B41AEA: virVMXParseConfig (vmx.c:1832) by 0x10B8E4: testCompareFiles (vmx2xmltest.c:79) by 0x10BAB8: testCompareHelper (vmx2xmltest.c:124) by 0x10D058: virTestRun (testutils.c:174) by 0x10CDDA: mymain (vmx2xmltest.c:288) by 0x10F11C: virTestMain (testutils.c:1096) Signed-off-by: Michal Privoznik Reviewed-by: Pino Toscano --- src/vmx/vmx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 35b83a2320..7bb5eb956d 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -1861,6 +1861,7 @@ virVMXParseConfig(virVMXContext *ctx, VIR_FREE(sched_cpu_shares); VIR_FREE(guestOS); virCPUDefFree(cpu); + VIR_FREE(firmware); =20 return def; } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list