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

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