yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

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