From nobody Sat May 18 16:17:54 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=1650983263; cv=none; d=zohomail.com; s=zohoarc; b=eedxT15sWHQ6lRc3Jv8tXtEI6TZDgcduE8uqflRmAW/qMdChmoH0MKAOxlSvZwd/tgga+CZMbsu3RkWmTDEkMGrE8CZ77YWmqHMiR3SVJlOO+CJbs10FVG78ydcghiySXUpslRQIiafIlJETA9T+KxaP6Je/TnNs1Zf/X2+BG0E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650983263; 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=0Lvxiigiqk+4qCzZ1AGnCZc1NB8VLS0OVujEJOqkpgc=; b=ePFTuZvRGnApg7YtVOcrp3tlr/WB/uZ8e5GR7lbKuznRkHWmdZ5D/ymH7FgDq1sBYlzoRa/wguuU+S0nT+EC1wtkSx9kBLNFDytyO1QzfdxQap8ZJ7xk5++rP/499jHMQZ38L7yZKR+u4527AZtqos6r5eqqIGwTxKu562xIJEI= 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 1650983263963200.44721392696317; Tue, 26 Apr 2022 07:27:43 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-606-KQbNfY_4PVOnLXyBCX1WHg-1; Tue, 26 Apr 2022 10:27:31 -0400 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 477FA381078B; Tue, 26 Apr 2022 14:26:58 +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 0B6DB41617F; Tue, 26 Apr 2022 14:26:56 +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 A10991947BBB; Tue, 26 Apr 2022 14:26:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3682219451EC for ; Tue, 26 Apr 2022 14:26:53 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7780440CFD0D; Tue, 26 Apr 2022 14:26:53 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id F102C40CFD0B; Tue, 26 Apr 2022 14:26:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650983263; 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=0Lvxiigiqk+4qCzZ1AGnCZc1NB8VLS0OVujEJOqkpgc=; b=MIqLN0F2id71WqOyD26YiOMYNxoLxxYkDnWvLXdWBoEZ/P/o0ccsNXTQHVzlI3RHaIIIbp dLY6KWM/tXpxkLgo3kk3Il7zZbCfD9zwbtE1Q/NAvTlUJ6GB/RvAR/X5nCvEvbkCQ8QG3a MDxVi/IqfTxRNLdmW1RbzlXIN/k/hnw= X-MC-Unique: KQbNfY_4PVOnLXyBCX1WHg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH] util: fix double destroy / missing unref of GSource Date: Tue, 26 Apr 2022 15:26:51 +0100 Message-Id: <20220426142651.714324-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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 2.85 on 10.11.54.10 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650983265563100001 A leak of the GSource was introduced in commit 87a43a907f0ad4897a28ad7c216bc70f37270b93 Author: Michal Pr=C3=ADvozn=C3=ADk Date: Fri Jan 28 18:42:45 2022 +0100 lib: Use g_clear_pointer() more As it mistakenly replaced the g_vir_source_unref call with a second call to g_source_destroy. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- src/util/vireventglib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/vireventglib.c b/src/util/vireventglib.c index fc04d8f712..3cc42597fd 100644 --- a/src/util/vireventglib.c +++ b/src/util/vireventglib.c @@ -227,7 +227,7 @@ virEventGLibHandleUpdate(int watch, goto cleanup; =20 VIR_DEBUG("Removed old handle source=3D%p", data->source); - g_source_destroy(data->source); + vir_g_source_unref(data->source, NULL); g_clear_pointer(&data->source, g_source_destroy); data->events =3D 0; } --=20 2.35.1