From nobody Sun May 19 02:07:01 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=1674736922; cv=none; d=zohomail.com; s=zohoarc; b=TbmV0y5/ofBr8TSfkOwAOO3MS5D9o4CgpQjUdlZPCzC5dkYZ7SgVz/8Htl19YQq7TrnBh8JGJCjeV1EpCVvTfxOSmprKx+qSa+8Oyn+KcQUVbXg7Sg1WuUFdQz8lBoO4Q/kjY8LdF79YNzphKg0iPNHCatHFElyPnpTuDpWlBMk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674736922; 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=36Tw4x/o1t7i48UujVWdmD1CrfRFh4AT1EButgMXJ2A=; b=gFFkuZfC6UgdvKJs1vugO3Zj+zG08erU6Rkl2G4uLXyVf0kKp92ndncsz2I+g1EipdymvO3eDIISqOyWeNa2nWjAOwpdeI5ZM9v/l6jcqIJBWLqcC7ve9mkUYX33lIFdEvq9ilNRILvYD6gNmhdM/lo+g/ddlDdH8fAeuDhKfts= 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 1674736922940687.7516338249551; Thu, 26 Jan 2023 04:42:02 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-182-ffr84pY6N9mkuYIK4FHBig-1; Thu, 26 Jan 2023 07:41:23 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 21735101A55E; Thu, 26 Jan 2023 12:41:22 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 69DDC492B01; Thu, 26 Jan 2023 12:41:21 +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 3FC04194658D; Thu, 26 Jan 2023 12:41:21 +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 016D1194658C for ; Thu, 26 Jan 2023 12:41:19 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AA69A2166B29; Thu, 26 Jan 2023 12:41:19 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 531412166B26 for ; Thu, 26 Jan 2023 12:41:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674736921; 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=36Tw4x/o1t7i48UujVWdmD1CrfRFh4AT1EButgMXJ2A=; b=d3qtBtwaOTwoflJWdc9530fhegCygfa7qI6gcE4I78/mpCmQN/d93J+ZnEldxe1hZUfftn 46aTSwnDMmwFaroTWjUAN9TKY/3aqASdjZVqm1Hb+l/kHAlYsgjSRc1HQTchoBrirEcFKh IumcgAZ9ghRQGGvByyuf83nN1r0pVDw= X-MC-Unique: ffr84pY6N9mkuYIK4FHBig-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu_domain: Don't unref NULL hash table in qemuDomainRefreshStatsSchema() Date: Thu, 26 Jan 2023 13:41:15 +0100 Message-Id: <4d1500dbecfe8b8e28dd24d075864143cbc867d9.1674736875.git.mprivozn@redhat.com> MIME-Version: 1.0 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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: 1674736924496100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The g_hash_table_unref() function does not accept NULL. Passing NULL results in a glib warning being triggered. Check whether the hash table is not NULL and unref it only then. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index b6ad118f1f..881c88d54c 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11923,7 +11923,8 @@ qemuDomainRefreshStatsSchema(virDomainObj *dom) if (!schema) return -1; =20 - g_hash_table_unref(priv->statsSchema); + if (priv->statsSchema) + g_hash_table_unref(priv->statsSchema); priv->statsSchema =3D schema; =20 return 0; --=20 2.39.1