Blame SOURCES/0001-ui-clipboard-Don-t-use-g_autoptr-just-to-free-a-vari.patch

495e37
From cc2f3e2ce9e2a9ab9e52e8f44bee4876e69843da Mon Sep 17 00:00:00 2001
495e37
From: John Snow <jsnow@redhat.com>
495e37
Date: Wed, 17 Nov 2021 09:51:46 -0500
495e37
Subject: ui/clipboard: Don't use g_autoptr just to free a variable
495e37
495e37
Clang doesn't recognize that the variable is being "used" and will emit
495e37
a warning:
495e37
495e37
  ../ui/clipboard.c:47:34: error: variable 'old' set but not used [-Werror,-Wunused-but-set-variable]
495e37
      g_autoptr(QemuClipboardInfo) old = NULL;
495e37
                                 ^
495e37
  1 error generated.
495e37
495e37
OK, fine. Just do things the old way.
495e37
495e37
Signed-off-by: John Snow <jsnow@redhat.com>
495e37
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
495e37
495e37
---
495e37
495e37
This is temporary commit from upstream submission necessary for build to pass.
495e37
We expect proper fix included upstream later.
495e37
---
495e37
 ui/clipboard.c | 3 ++-
495e37
 1 file changed, 2 insertions(+), 1 deletion(-)
495e37
495e37
diff --git a/ui/clipboard.c b/ui/clipboard.c
495e37
index d7b008d62a..d53576b0f6 100644
495e37
--- a/ui/clipboard.c
495e37
+++ b/ui/clipboard.c
495e37
@@ -44,13 +44,14 @@ void qemu_clipboard_peer_release(QemuClipboardPeer *peer,
495e37
 
495e37
 void qemu_clipboard_update(QemuClipboardInfo *info)
495e37
 {
495e37
-    g_autoptr(QemuClipboardInfo) old = NULL;
495e37
+    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