From nobody Tue Feb 10 02:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1638909895878697.8118403190393; Tue, 7 Dec 2021 12:44:55 -0800 (PST) Received: from localhost ([::1]:55476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muhKY-00023A-Pp for importer@patchew.org; Tue, 07 Dec 2021 15:44:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muhHO-0006sV-KX for qemu-devel@nongnu.org; Tue, 07 Dec 2021 15:41:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:51352) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muhHM-0001X5-RT for qemu-devel@nongnu.org; Tue, 07 Dec 2021 15:41:38 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-524-pkgDj18zMSaW0iFm_mE37Q-1; Tue, 07 Dec 2021 15:41:33 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 59F5C347AA; Tue, 7 Dec 2021 20:41:28 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.11.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A6EC56A84; Tue, 7 Dec 2021 20:41:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638909696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jcvDFRD7wH73IBrzFUVypp8m7aFaIeCDOjPBTV5Wx8g=; b=BsczS+yCiLemRRVI4rWNXJHCmDS7idldk1fsll9Cgt9ekoSCdF3LR/poP08l/Xhx3WsKUa W5Z5ksKcMx4oDCdf73NFjiTAlk1JAkAVs+MfPZsfGh+hETJmwv/LlunAKmL/u1Z9ak2B0g F1LI9JllaqPmyDEzWYIuZ1Su9AIUxr4= X-MC-Unique: pkgDj18zMSaW0iFm_mE37Q-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v2 2/2] ui/clipboard: Don't use g_autoptr just to free a variable Date: Tue, 7 Dec 2021 15:40:38 -0500 Message-Id: <20211207204038.664133-3-jsnow@redhat.com> In-Reply-To: <20211207204038.664133-1-jsnow@redhat.com> References: <20211207204038.664133-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.619, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Berrange , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Philippe Mathieu Daude , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1638909897641100001 Content-Type: text/plain; charset="utf-8" Clang doesn't recognize that the variable is being "used" and will emit a warning: ../ui/clipboard.c:47:34: error: variable 'old' set but not used [-Werror,= -Wunused-but-set-variable] g_autoptr(QemuClipboardInfo) old =3D NULL; ^ 1 error generated. OK, fine. Just do things the old way. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- ui/clipboard.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/clipboard.c b/ui/clipboard.c index d7b008d62a..9ab65efefb 100644 --- a/ui/clipboard.c +++ b/ui/clipboard.c @@ -44,12 +44,11 @@ void qemu_clipboard_peer_release(QemuClipboardPeer *pee= r, =20 void qemu_clipboard_update(QemuClipboardInfo *info) { - g_autoptr(QemuClipboardInfo) old =3D NULL; assert(info->selection < QEMU_CLIPBOARD_SELECTION__COUNT); =20 notifier_list_notify(&clipboard_notifiers, info); =20 - old =3D cbinfo[info->selection]; + g_free(cbinfo[info->selection]); cbinfo[info->selection] =3D qemu_clipboard_info_ref(info); } =20 --=20 2.31.1