thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-Revert-ui-clipboard-Don-t-use-g_autoptr-just-to-free.patch

495e37
From 213d2c6d3138f3570bca36edaacfd1ee86b18967 Mon Sep 17 00:00:00 2001
495e37
From: Gerd Hoffmann <kraxel@redhat.com>
495e37
Date: Fri, 4 Feb 2022 06:45:51 +0100
495e37
Subject: [PATCH 1/6] Revert "ui/clipboard: Don't use g_autoptr just to free a
495e37
 variable"
495e37
MIME-Version: 1.0
495e37
Content-Type: text/plain; charset=UTF-8
495e37
Content-Transfer-Encoding: 8bit
495e37
495e37
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
495e37
RH-MergeRequest: 75: fix vnc cut+paste crash
495e37
RH-Commit: [1/4] 0937d15054ad6e902bc22d1872231504f442ddcc (kraxel/centos-qemu-kvm)
495e37
RH-Bugzilla: 2042820
495e37
RH-Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
495e37
RH-Acked-by: Daniel P. Berrangé <berrange@redhat.com>
495e37
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
495e37
495e37
This reverts commit 8df1ea81ee6c674522967d056daa8d3748fa3883.
495e37
---
495e37
 ui/clipboard.c | 3 +--
495e37
 1 file changed, 1 insertion(+), 2 deletions(-)
495e37
495e37
diff --git a/ui/clipboard.c b/ui/clipboard.c
495e37
index d53576b0f6..d7b008d62a 100644
495e37
--- a/ui/clipboard.c
495e37
+++ b/ui/clipboard.c
495e37
@@ -44,14 +44,13 @@ void qemu_clipboard_peer_release(QemuClipboardPeer *peer,
495e37
 
495e37
 void qemu_clipboard_update(QemuClipboardInfo *info)
495e37
 {
495e37
-    QemuClipboardInfo *old = NULL;
495e37
+    g_autoptr(QemuClipboardInfo) old = NULL;
495e37
     assert(info->selection < QEMU_CLIPBOARD_SELECTION__COUNT);
495e37
 
495e37
     notifier_list_notify(&clipboard_notifiers, info);
495e37
 
495e37
     old = cbinfo[info->selection];
495e37
     cbinfo[info->selection] = qemu_clipboard_info_ref(info);
495e37
-    g_free(old);
495e37
 }
495e37
 
495e37
 QemuClipboardInfo *qemu_clipboard_info(QemuClipboardSelection selection)
495e37
-- 
495e37
2.27.0
495e37