From nobody Wed May 8 22:29:59 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=1569507919; cv=none; d=zoho.com; s=zohoarc; b=IQHGMl23WhzJqDCvBxBJXfjjm6wBoFCmkmQYAmWJ4zM6qMbV41bHm8E+o4IgDx6xxdFrI2Nn65x/A90W1tB3d8sSO1QXTc20rjkudGGuVzo8sMdagptN3F5YJ7JPFhhJRQjVUseqTVBeOQztiYQl6aApnuT3QuG+Ea2GvhsO9kM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569507919; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=URB12B1KH9PJpHWXhK83ukj7lwHYrgsW5m5sy4eruFY=; b=A39DMFOVRo37O3RiIBoBPqeKzIG8BeggUDZJ3nJR0pXfBuQ74r4DgZcOhrTi38EJIc4W7M8wsRGbl4QRBaAXmUhC0qa7XdBQ5vAJfunuWm9UcPct7e8+ccUKOfOu+zkSSmoz2mvLH6XDvKZ9h4GTJUMIVIg2TWIjEZEhkcP0Qnc= 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 1569507919733541.8760652197842; Thu, 26 Sep 2019 07:25:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C825A2A09CC; Thu, 26 Sep 2019 14:25:16 +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 D4496A212; Thu, 26 Sep 2019 14:25:15 +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 E6E0F83542; Thu, 26 Sep 2019 14:25:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8QEPBLl026229 for ; Thu, 26 Sep 2019 10:25:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3FB225C21F; Thu, 26 Sep 2019 14:25:11 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id BC8E95C221 for ; Thu, 26 Sep 2019 14:25:08 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Thu, 26 Sep 2019 16:25:05 +0200 Message-Id: <856d1b54d61e9260797a30bfba6633fe0114613c.1569507905.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] domain_conf: Unref video private data in virDomainVideoDefClear() 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 26 Sep 2019 14:25:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The private data for video definition is created in virDomainVideoDefNew() and we attempt to free it in virDomainVideoDefFree(). This seems to work, except the free function calls clear function which zeroes out the whole structure and thus virObjectUnref() which is called on private data does nothing. 2,568 bytes in 107 blocks are definitely lost in loss record 207 of 213 at 0x4A35476: calloc (vg_replace_malloc.c:752) by 0x50A6048: virAllocVar (viralloc.c:346) by 0x513CC5A: virObjectNew (virobject.c:243) by 0x4DC1DEE: qemuDomainVideoPrivateNew (qemu_domain.c:1337) by 0x51A6BD6: virDomainVideoDefNew (domain_conf.c:2831) by 0x51B9F06: virDomainVideoDefParseXML (domain_conf.c:15541) by 0x51CB761: virDomainDefParseXML (domain_conf.c:21158) by 0x51C5973: virDomainDefParseNode (domain_conf.c:21708) by 0x51C583A: virDomainDefParse (domain_conf.c:21663) by 0x51C58AE: virDomainDefParseFile (domain_conf.c:21688) Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 67555c9be3..c290baf953 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2853,6 +2853,7 @@ virDomainVideoDefClear(virDomainVideoDefPtr def) if (def->driver) VIR_FREE(def->driver->vhost_user_binary); VIR_FREE(def->driver); + virObjectUnref(def->privateData); =20 memset(def, 0, sizeof(*def)); } @@ -2864,7 +2865,6 @@ void virDomainVideoDefFree(virDomainVideoDefPtr def) return; =20 virDomainVideoDefClear(def); - virObjectUnref(def->privateData); VIR_FREE(def); } =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list