From nobody Mon Feb 9 04:31:02 2026 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=1629896131; cv=none; d=zohomail.com; s=zohoarc; b=fvV8fQiEsYwhnN3+YhjZatFk7+eFuh2BGm5ON0m3+vCmsukdTHY+v4RjLB8D1SjmmACVimO8iYmG0mOwM+O6vHAW8jnKkEkc8wIhsLtZQo4PQXszxawkBPDvJKcFuJdLQW6K9h8diqCiViMArcpndMtmbEaMn3rFGGbVkDx4fm0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629896131; 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; bh=UKx1EzJiXvOA1ZCbtmzP/S227uYNXbyy4Z4BC6JRirs=; b=ClsKaSriwiGV1NBwU+H/DuWTZe0RO6kbEQf2fn8fIpLNDI8F0RYz8vjk86dBVZlGZtIQLbpg+E4QK5Ic/orB2IWTacaGab0RH53rIHn5Fb+jODDlIHQe2sequAhpiMVRXgx5+yEI0z5Fwo9PQkT96THghY0Ner7COntru14fTVQ= 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 1629896131044519.7530825929894; Wed, 25 Aug 2021 05:55:31 -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-418-pD69N31QOKqUMZ9YYt5tSw-1; Wed, 25 Aug 2021 08:55:28 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D219B8799EF; Wed, 25 Aug 2021 12:55:19 +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 AFF9A68D95; Wed, 25 Aug 2021 12:55:19 +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 7EF194A708; Wed, 25 Aug 2021 12:55:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17PCtDTP015152 for ; Wed, 25 Aug 2021 08:55:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 875E510016FB; Wed, 25 Aug 2021 12:55:13 +0000 (UTC) Received: from bart.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1206910074F8 for ; Wed, 25 Aug 2021 12:55:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629896129; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=UKx1EzJiXvOA1ZCbtmzP/S227uYNXbyy4Z4BC6JRirs=; b=WzF7gpZvGelkhO6igUerd1ZZzje85lzCetKQ1RjUjY9eU5qERu5+76v6ZMhhCzd+fE0JuV lwo1HAIltaZcCJR04NwxDigFAa0KVvKfSsDM5oU49LgVDTcaqa2dmgX3DHH2RqHDgEC77s B1WYP8brzIDgM/8zmRyxmIWyNXjUI1M= X-MC-Unique: pD69N31QOKqUMZ9YYt5tSw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 4/4] DO NOT MERGE Date: Wed, 25 Aug 2021 14:54:59 +0200 Message-Id: <4bff1f12e4653f374979a0d54381c41e8e432923.1629895768.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.79 on 10.5.11.16 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: 1629896131466100001 Content-Type: text/plain; charset="utf-8" This patch is intentionally wrong (it's leaking memory). I just include it to illustrate Clang bug. Signed-off-by: Michal Privoznik --- src/rpc/virnetclient.c | 9 ++++++--- src/util/viridentity.c | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index ffe2f343f9..eb215f13db 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -882,7 +882,7 @@ virNetClientIOEventTLS(int fd, static gboolean virNetClientTLSHandshake(virNetClient *client) { - g_autoptr(GSource) source =3D NULL; + GSource *source =3D NULL; GIOCondition ev; int ret; =20 @@ -901,6 +901,7 @@ virNetClientTLSHandshake(virNetClient *client) ev, client->eventCtx, virNetClientIOEventTLS, client, NU= LL); + g_source_unref(source); =20 return TRUE; } @@ -939,7 +940,7 @@ int virNetClientSetTLSSession(virNetClient *client, int ret; char buf[1]; int len; - g_autoptr(GSource) source =3D NULL; + GSource *source =3D NULL; =20 #ifndef WIN32 sigset_t oldmask, blockedsigs; @@ -1028,6 +1029,7 @@ int virNetClientSetTLSSession(virNetClient *client, virObjectUnref(client->tls); client->tls =3D NULL; virObjectUnlock(client); + g_source_unref(source); return -1; } =20 @@ -1664,7 +1666,7 @@ static int virNetClientIOEventLoop(virNetClient *clie= nt, #endif /* !WIN32 */ int timeout =3D -1; virNetMessage *msg =3D NULL; - g_autoptr(GSource) source =3D NULL; + GSource *source =3D NULL; GIOCondition ev =3D 0; struct virNetClientIOEventData data =3D { .client =3D client, @@ -1810,6 +1812,7 @@ static int virNetClientIOEventLoop(virNetClient *clie= nt, virNetClientMarkClose(client, closeReason); goto error; } + g_source_unref(source); } =20 error: diff --git a/src/util/viridentity.c b/src/util/viridentity.c index e36e54ae4b..dbaacd6da5 100644 --- a/src/util/viridentity.c +++ b/src/util/viridentity.c @@ -134,12 +134,13 @@ virIdentity *virIdentityGetCurrent(void) */ int virIdentitySetCurrent(virIdentity *ident) { - g_autoptr(virIdentity) old =3D NULL; + virIdentity *old =3D NULL; =20 if (virIdentityInitialize() < 0) return -1; =20 old =3D virThreadLocalGet(&virIdentityCurrent); + g_clear_object(&old); =20 if (virThreadLocalSet(&virIdentityCurrent, ident ? g_object_ref(ident) : NULL) < 0) { --=20 2.31.1