From nobody Fri May 3 18:45:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1628155331; cv=none; d=zohomail.com; s=zohoarc; b=MNX/au10FPfoQx/z4VXZNbt0O1v7KAq53Q+aEKC6+0Mb//lZZQl2+8KyLRgV4g3RdgLQxaAxad53NtzKojag+l+HAMYcqHGK9Qh+KZPyJQnr/VTbU3FNFF7LuJHCVDOE+6BPoIq6P0B9rstS0CZGjf/wlqS6ZqMi0ZRfHOWTFwc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628155331; 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; bh=7/aC6nj9cf5BS4J9i/w6cGUQ9GeSwZWAnqiGnxTW6eI=; b=nbJWG5J/IPKEJg3CcO0eU+/hL9PtTVQzkesHh2FW6uQ7t5sxirlQavqXkp507q+Hthno+7aYpm0Cc+IpVRbNMOmt3LYshsc0GHNfK2sFVfdSo1K69jG6uN3NRXrpkzRKPsmmd4KuT4YHwt6H7sYcJv72FVxss4z/6GeRscLsbE8= 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; dmarc=pass header.from= (p=none dis=none) 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 1628155331670953.3350131731022; Thu, 5 Aug 2021 02:22:11 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-256-Pa78ZB2cOESoQBKdMwQHxQ-1; Thu, 05 Aug 2021 05:22:08 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 30D30801AE7; Thu, 5 Aug 2021 09:22:02 +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 5FB4327CA1; Thu, 5 Aug 2021 09:22: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 E42B14BB7C; Thu, 5 Aug 2021 09:21:56 +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 1759JwT4015304 for ; Thu, 5 Aug 2021 05:19:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id B629918401; Thu, 5 Aug 2021 09:19:58 +0000 (UTC) Received: from bart.redhat.com (unknown [10.43.2.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E5B25D6A1 for ; Thu, 5 Aug 2021 09:19:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628155330; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=7/aC6nj9cf5BS4J9i/w6cGUQ9GeSwZWAnqiGnxTW6eI=; b=A8NyA2XUKWVC/wJZkcQbdC0h5EsB6Yw1wTFjZVOavvBKCqFfANFN6rNZACVoZddDNh/jrh u6B70v/3r0iaOs2qwsmewQDtVi825BZALTkQbpZsLOGlm76F5VQhogDr+KaU4XB/uBNUP3 L0+IwvEwVSNDKpUUW9pF0Cy9xYQ29UQ= X-MC-Unique: Pa78ZB2cOESoQBKdMwQHxQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] tests: Don't leak cpu defs Date: Thu, 5 Aug 2021 11:19:52 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1628155332783100001 Content-Type: text/plain; charset="utf-8" There are cpu definitions that are allocated in qemuTestDriverInit() but are missing corresponding virCPUDefFree() call in qemuTestDriverFree(). It's safe to call the free function because the definitions contain a refcounter and thus even if they were still in use the refcounter would be just decreased. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- tests/testutilsqemu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index fab676c070..9a0666724a 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -332,6 +332,11 @@ void qemuTestDriverFree(virQEMUDriver *driver) virObjectUnref(driver->caps); virObjectUnref(driver->config); virObjectUnref(driver->securityManager); + + virCPUDefFree(cpuDefault); + virCPUDefFree(cpuHaswell); + virCPUDefFree(cpuPower8); + virCPUDefFree(cpuPower9); } =20 int qemuTestCapsCacheInsert(virFileCache *cache, --=20 2.31.1